1

Inconsistent input redirection behavior

view story
linux-howto

http://unix.stackexchange.com – I wrote a 10000010-byte file (99010 rows of 100 consecutive a's) named big for experimentation purposes. I then copied the entire text into my clipboard, ran wc, and pasted it into stdin. Next, I did a simple redirection that's supposed to have the exact same effect. But this is what I got: $ wc[Enter] [paste 99010 lines of garbage copied directly from `big'] 99010 99010 10000010 $ wc < big 99010 99010 10000010 Notice the different field widths. My best guess is that the first result was printed with "%7d %7d %7d", and the second with "%8d %8d %8d". Can someone please explain (HowTos)