3 ms·
Back in my BSD-on-a-VAX days, I once typed grep string * > out and wondered why it was taking so long. The shell (probably csh) had created the file "out" b
by rootbear 6y ago
Back in my BSD-on-a-VAX days, I once typed
grep string * > out
and wondered why it was taking so long. The shell (probably csh) had created the file "out" before it expanded the *, so my grep command was forever finding "string" in it's own output. It filled the disk before I realized what was happening. I just did a quick test and bash seems to create the output file after doing the globbing, and under tcsh, grep gave a warning that the output file was also an input file and it did not search it.