2 ms·
For what it's worth, backing your statement of "it used to be simpler" with an example of how easy it used to be to get the wrong answer does not make for a goo
by chias 6y ago
For what it's worth, backing your statement of "it used to be simpler" with an example of how easy it used to be to get the wrong answer does not make for a good argument.
The example provided: "how many files in a directory? just pipe `ls` to `wc` and because `ls` output is one file per line, you've got your answer!" Except newlines are totally valid characters to have in filenames. Try it:
echo "foo" > 'test
file.txt'
ls | less
ls | wc -l
Pipe the output of `ls` to `less` to see the old-style one-line-per-file output to see what you get.
Run `ls | wc -l` and see the wrong answer pop up.