Input redirection in pipes
From Linux Shell Scripting Tutorial - A Beginner's handbook
- The input < redirection symbol can be used with pipes to get input from a file:
command1 < input.txt | command2 command1 < input.txt | command2 arg1 | command3
For example, the sort command will get input from /etc/passwd file, which is piped to grep command:
sort < input.txt | grep something sort < input.txt | uniq | grep something