Cat piped output

Hello,
How can I efficiently cat piped output with another file?

> (awk command) | cat file1 (piped output)

Thanks!

zsh-4.3.14[t]% echo file1 content > file1
zsh-4.3.14[t]% awk 'BEGIN { print "output comming from", ARGV[0] }' |
pipe> cat file1 -
file1 content
output comming from awk
1 Like

Thanks... That '-' symbol was the key.

I don't know what's funnier; the original post or the reply!
You're in left field my friends.

What, exactly, are you trying to accomplish?
What does feeding the standard out from your first command into cat have to do with another file? And why would you want to pipe the output from your first command (which will display something) into cat (to display it) anyhow?

Do you mean that you want to show the output from the first command on the screen as well as write it to a file?

I don't think an entire book of recommendations and suggestions is needed every time somebody doesn't remember a bit of shell syntax.

@rcmjivaro. cat stands for concatenate and that is what the OP is trying to do.

Oops. Sorry. The post from radoulov wasn't there when I posted. The original didn't make sense to me and after reading his it is clear I should stay out of your homework. I submit myself for well deserved flaming if you care to continue.

for obtuse in $comments;do
    if [ "${obtuse}" ==  "yes" ];then
        echo -e $flame | tee -a ~/deserved.txt
    fi
done

Hi rcmjivaro,
just to clarify: I agree that in most cases asking for more information is appropriate
and when the OP's approach is obviously wrong, we're supposed
to guide her/him and teach her/him and we should explain why what she/he's doing is wrong.

I don't find anything in the above post that's obviously wrong (maybe it's just me),
I just don't have enough information to determine it.

I still think that this post could be useful because it reminds (something
that most readers already know) how most Unix utilities read from standard input.

I have tried the same, but not working:

ubuntu% awk 'BEGIN { print "output comming from", ARGV[0] }' |pipe> cat file1 -
zsh: command not found: pipe

@Pandeesh

Omit "pipe>"

@pandeesh
Please stop hijacking threads.

Yes,
correct, thanks!

This is a nice zsh feature (sorry for the confusion), I should have removed that part
in order to make the output more clear:

zsh-4.3.14[sysadmin]% print '
quote>  
quote> 
quote> '




zsh-4.3.14[sysadmin]% : <<!
heredoc> 
heredoc> 
heredoc> ok
heredoc> !
zsh-4.3.14[sysadmin]% for f in *; do
for> print -- $(( ++i ))
for> done
1
2
3
4
5
6
7
8
zsh-4.3.14[sysadmin]% ls |
pipe> sort
Measuring Scalability and Performance with TCP, Baron Schwartz, Percona.wmv
...