3 ms·
Isn't `some-command < somefile` more idiomatic (also, should spawn one process less)?
by klez 9y ago
Isn't `some-command < somefile` more idiomatic (also, should spawn one process less)?
- aepiepaey 9y agoYes. See "Useless use of cat" (or "UUOC"). If you prefer to have the command arguments at the end of the line (so it's easier to amend), you can do e.g: < file.txt grep pattern instead of grep pattern file.txt or cat file.txt | grep pattern There are also some related useless uses, like useless use of grep | awk: grep pattern file | awk '{print $3}' which can instead be written as awk '/pattern/ {print $3}' file