CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Command Help (https://www.cfd-online.com/Forums/openfoam-pre-processing/95227-command-help.html)

shridhargrao December 10, 2011 04:17

Command Help
 
What does this command actually do "grep"Net mass flux" $1 |awk '{print $3}' > timeList.dat" ?

wyldckat December 12, 2011 17:09

Greetings Shridhar,

A bit of context would be nice... anyway, that command line is split in two parts:
  1. grep searches for the lines that have "Net mass flux".
  2. The output from grep gets piped through "|" and sent to awk for processing; awk prints out the 3rd value it picks up on each of those lines, if I'm not mistaken.
To learn more about grep and awk:
Code:

man grep
man awk

Searching online for tutorials for each command will also get you more information. I also suggest tutorials about bash, so you can understand the first "$1" ;)

Best regards,
Bruno


All times are GMT -4. The time now is 14:54.