I figured it out last night. The problem was that the first line of the input file did not define the Output variable, so awk didn't know where to send it's output. Thanks if you tried to help! Final Program: #!/bin/sh # # awk 'BEGIN { Output="/dev/null" } { if ($0 ~ "^IXXPS2-") Output=$1 print >>Output }'