View Single Post
  #1 (permalink)  
Old 01-Jul-2009, 17:12
opensuseforumorg42 opensuseforumorg42 is offline
Puzzled Penguin
 
Join Date: Nov 2008
Posts: 28
opensuseforumorg42 hasn't been rated much yet
Question Bash: Can stdout go to terminal and pipe?

Code:
cat MailingList | cut -d, -f1 | sort -u | wc -l
An example command is shown above. The output would be something like:

name1
name2
2

I'd like the output from the sort to go to the terminal as well as to the pipe.

I've used tee before, but I want all output to go to the terminal. I did some googling and scanned the bash doc at tldp which lend me down the path of trying a combination of parenthesis around the commands (subshell) and file descriptor redirecting. I haven't been successful. Any thoughts?

Thank you.
Reply With Quote