I am ashamed to ask such a basic question, but it seems I have a major flaw in my understanding of pipes. I read this:
Do 'cat foo.txt | my_cmd' and 'my_cmd < foo.txt' accomplish the same thing?
and quite a few other posts, but I cannot fathom why the mentioned statement doesn't print the contents of foo.txt. Originally, I had tried
cat /etc/passwd | cut -d: -f1 | sort | echo
and eventually reduced the problem to what is listed. Interestingly, if I leave out the pipe and echo at the end everything works mostly well- although I didn't want newlines. I can also
cut -d: -f1 < /etc/passwd | sort
and get the same result (also unfortunately with newlines.) Maybe echo doesn't accept stdin? The man page doesn't mention it either way. It seems like a fairly useful addition to its functionality, but I guess it could make things more complicated if both stdin and arguments were supplied.
I know I'm being braindead about this. Theres no rush in answering this- I'm just curious. Thanks for your time!