Here is the code from words.sh
cat /dev/stdin\
| tr 'A-Z' 'a-z'\
| sed 's/[^a-z\.]/ /g'\
| tr -s ' .'\
| sed 's/\./ \. /g'\
| tr -s ' '\
| tr ' ' '\n'\
| grep -v '^$';
exit 0;
Isn't that a Useless Use Of Cat? It works without the cat and the first pipe character.Similarly:
cat moby-dick.txt | ./words.sh > words.txt
This could be: < moby-dick.txt ./words.sh > words.txt
cat is for concatenating files