3 ms·
echo * does not have the newline after each file
by j16sdiz 3y ago
echo * does not have the newline after each file
- fuzztester 3y agoTrue, echo * will print all the filenames on one line, with a space between pairs, but for data processing purposes, the two snippets are equivalent, because as per shell behavior, newline, tab and space are all treated as space, unless quoted. Like the definition of whitespace in the K&R C book. After all, Unix is written in C.
- cdrt 3y agoYou wouldn’t iterate over `echo *` anyway. This works just fine in bash/sh: for file in *; do echo "$file" done