Reputation: 1439
Look at the below code
awk '{print $1}' grep _Y myFile
I want to pass the result of grep _Y myFile
to awk command . How to write that line correctly .
Upvotes: 0
Views: 58
Reputation: 31
Maybe <()
would work?
It sends the output of a command to another command as a file.
I.e. awk '{print $1}' <(grep _Y myFile)
Also great for use with diff
See this for more details.
Upvotes: 3
Reputation: 174796
Use pipe |
symbol to redirect the output of prceeding command to the following command,
grep _Y myFile | awk '{print $1}'
Upvotes: 2