gawk is the GNU variant of the awk command which is a versatile text processing tool. In above script, the first gawk removes all lines from stdin that don't contain the <!--.*--> string, where .* is a wild card matching any multi character combination, and prints the reminder to stdout which is piped to another gawk that runs an - unknown to us - script ( /data/work/PROU/parseAGG.awk ) on it using a variable called GCPATH .