Mail Archives: djgpp/1998/03/27/09:51:28
Hi all.
This is with reference to the recent thread about "cat -", wherein,
I gather, it was concluded that this was a problem specific to "cat".
But on my system..
C:\>bash
bash$ cat -
^Z
bash$ tac -
bash$ gawk --file=-
bash$ expand -
bash$ as
bash$
Now this is even funnier:
C:\>bash
bash$ cat -
^Z
bash$ wc
0 0 0
bash$ wc
<waits for input, like it should>
I find that the above sequence can be generalized to:
C:\>bash
bash$ cat -
^Z
bash$ <any program that does not print anything when given an empty i/p
file -- displays the funny behaviour>
bash$ <any program that prints anything at all on screen>
o/p of above pgm
bash$ cat
<waits for input, like it should>
Programs of the first category include addr2line (binutils), gasp
(binutils), gawk (gawk) and a horde of others, from various packages,
and hence I suppose bash is the culprit.
ls, "cat non_existing_file" etc. come under the second category.
And just to test that it is the printing-to-the-screen part that
nullifies the anomaly:
C:\>bash
bash$ cat - # simply "cat" will do, BTW
^Z
bash$ any_program >/dev/null 2>&1
bash$ cat
bash$
<funny behaviour continues>
Finally, just one more thing:
C:\>bash
bash$ cat
^Z
bash$ cat # funny behaviour starts..
bash$ cat <TAB><TAB>
autoexec.bat config.sys utils (completions displayed by bash)
bash$ cat # cmd line redisplayed by bash, just hit enter
bash$ cat # funny behaviour continues..
bash$
Comments ?
(Sorry about the new thread, this mail reader does not seem to know about
RFC934 (or whatever)).
Happy bashing,
Mahesh (Mahadevan R.), <mdevan AT iname DOT com>
- Raw text -