CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   Command Help (

shridhargrao December 10, 2011 05:17

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

wyldckat December 12, 2011 18: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:

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,

All times are GMT -4. The time now is 16:56.