----- Original Message -----
$ cat > test-in <<_EOF_
+ mod | cat > test-out
+ _EOF_
$ crash [....]
crash> < test-in
crash> quit
$ cat test-out
crash> mod | cat > test-out
MODULE NAME SIZE OBJECT FILE
[....]
That first line does not belong in "test-out".
It is very noticeable if "cat" were trying to parse the "mod"
output.
WRT printf, you can always add another global: trace_fp
and let that one be the fp for writing trace logs. But it should
always be stdout. (Well, "stderr", actually, but you are already
printing your command traces to stdout.)
What happens when the "silent" environment variable is set "on"?
(i.e., run "crash -s ..." or enter "set silent on" during runtime)
Dave
On Thu, Feb 16, 2012 at 7:59 AM, Dave Anderson
<anderson(a)redhat.com>
wrote:
>
> I'm not sure I agree...
>
>> $ diff -u *~ cmdline.c
>> --- cmdline.c~ 2012-02-03 11:22:33.000000000 -0800
>> +++ cmdline.c 2012-02-15 16:51:07.209524248 -0800
>> @@ -1372,10 +1372,8 @@
>> if (!(argcnt = parse_line(pc->command_line,
>> args)))
>> continue;
>>
>> - if (!(pc->flags & SILENT)) {
>> - fprintf(fp, "%s%s", pc->prompt, buf);
>> - fflush(fp);
>> - }
>> + if (!(pc->flags & SILENT))
>> + printf("%s%s", pc->prompt, buf);
>>
>> exec_command();
>> }
>
> Can you show an example of the problem that you're trying
> to handle?
>
> Also, printf() is never used by the crash utility. (well, except
> by some dead va_server.c code, some dead remote.c debug code,
> and a couple places in s390dbf.c which I don't control...)
>
> Dave