Cat piped output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cat piped output
# 1  
Old 01-14-2012
Cat piped output

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

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

Thanks!

Last edited by radoulov; 01-14-2012 at 06:38 PM.. Reason: Code tags!
# 2  
Old 01-14-2012
Code:
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

This User Gave Thanks to radoulov For This Post:
# 3  
Old 01-14-2012
Thanks... That '-' symbol was the key.
# 4  
Old 01-15-2012
humor

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?
# 5  
Old 01-15-2012
Quote:
You're in left field my friends.

What, exactly, are you trying to accomplish?
[...]
I don't think an entire book of recommendations and suggestions is needed every time somebody doesn't remember a bit of shell syntax.

Last edited by radoulov; 01-15-2012 at 12:59 PM.. Reason: Selfmoderation :)
# 6  
Old 01-15-2012
@rcmjivaro. cat stands for concatenate and that is what the OP is trying to do.
# 7  
Old 01-15-2012
oops

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.
Code:
for obtuse in $comments;do
    if [ "${obtuse}" ==  "yes" ];then
        echo -e $flame | tee -a ~/deserved.txt
    fi
done


Last edited by radoulov; 01-15-2012 at 12:59 PM.. Reason: Code tags!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Running java script from piped output

to run most other scripts through a pipe, something similar to the following is usually enough: cat script.sh | sh cat perl.pl | perl -- "<arguments" However, for javascript command line scripts, i cant seem to get this to work. Any ideas? cat hull.js #!/usr/bin/js ... (3 Replies)
Discussion started by: SkySmart
3 Replies

2. Shell Programming and Scripting

Print line number from piped output

i need to do something like this: script.sh #!/bin/sh echo "hello" echo "My First name is John" echo "My Last name is Smith" echo "I am here to save you a lot of work" sed -n 4,5p $0 i dont want to run the script. i just want to pull out specific line from it. so the logic here... (5 Replies)
Discussion started by: SkySmart
5 Replies

3. Shell Programming and Scripting

Can't Output Piped Perl In-line command to a File

Hello, I'm pretty stumped, and I don't know why I am not able to redirect the output to the 'graphme' file with the command below in Fedora 18. tcpdump -l -n -t "tcp == 18" | perl -ane '($s,$j)=split(/,/,$F,2); print "$s\n";' > graphme In case you're wondering, I was following the example... (2 Replies)
Discussion started by: ConcealedKnight
2 Replies

4. Shell Programming and Scripting

Output piped to case insensitive awk

I have an encrypted password file, and I've created a simple script to search the password file for a particular record. There are multiple lines per record, so I'm using a record delimiter. #!/bin/bash PATTERN=$1 openssl des3 -d -salt -in ~/docs/pass.des3 | awk '{ FS="\n" ; RS="*" }... (2 Replies)
Discussion started by: 0rac1e
2 Replies

5. Shell Programming and Scripting

script output should be piped to a file

hi i have a script named mount.sh under the location /data/scripts/ in my aix box i want this script this to be run everyday morning at 04:45 AM and the output of the script should be piped to a file how to do this ? (3 Replies)
Discussion started by: samsungsamsung
3 Replies

6. Shell Programming and Scripting

Piped output from SSH tunnel hangs?

Hi All, When starting an SSH tunnel, piped output 'hangs' (on AIX) : ssh -Nf -Llocalhost:22000:server:22 proxy | cat -vet - ... hangs ... Does anybody know how to prevent this? Of course, in my script I don't use the tunnel as I do in the example above. In my script the call to ssh is... (7 Replies)
Discussion started by: whbos
7 Replies

7. Shell Programming and Scripting

Directing only part of a script's output to piped application

Is there a way to keep the output of a script displayed on the terminal when it's run by itself, but suspend part of that output and only have a specific part delivered when it's piped to another script or program? I'm thinking something like the following pseudocode: #!/bin/bash ... (1 Reply)
Discussion started by: trigg
1 Replies

8. Shell Programming and Scripting

find output seems to change when piped

Currently, i am trying to create a simple robust script that is intended to move the contents of a given source directory to a target directory. Optionally, the script should allow to either move the whole source dir content, or dotfiles only, or visible files only. I am aware the target directory... (0 Replies)
Discussion started by: shells_bells
0 Replies

9. Shell Programming and Scripting

Concatenate piped output and some var?

Hello, There is pipe chain and I want concacenate piped data with some variable: balh blah| ... $var1 What command I should use instead ... to concatenate piped output with $var1. I think I coud solve this using temp var - but could it be done in one line like sample above ? thanks... (4 Replies)
Discussion started by: vilius
4 Replies

10. Shell Programming and Scripting

Exclude Certain Entries from Piped or Redirected Output?

I want to execute a command something like: find / -name "jni.h" and I want to direct the output of that command to some type of filter that will leave out all the lines reporting inaccessible directories (permission unavailable). Is this a pipe or a redirect? For example, output like... (1 Reply)
Discussion started by: downplay
1 Replies
Login or Register to Ask a Question