Many people use oneliners and scripts containing code along the lines
cat "$MYFILE" | command1 | command2 > "$OUTPUT"
cat is often called "useless use of cat" because technically it requires starting a new process (often
/usr/bin/cat) where this could be avoided if the command had been
< "$MYFILE" command1 | command2 > "$OUTPUT"
because then shell only needs to start
command1 and simply point its
stdin to the given file.
Why doesn't the shell do this conversion automatically? I feel that the "useless use of cat" syntax is easier to read and shell should have enough information to get rid of useless cat automatically. The
cat is defined in POSIX standard so shell should be allowed to implement it internally instead of using a binary in path. The shell could even contain implementation only for exactly one argument version and fallback to binary in path.