So I've been working on an assignment pertaining to awk. Everything is pretty much done, except when I throw commands into a bash script (run eleven of them all automagically) I don't get any output. Am I missing some sort of syntax that awk needs to work in a script? Thanks!
I'll just give you the first four to give you an idea:
#!/bin/sh
##VARIABLES
W=/usr/share/dict/words
C=cars_file
P=/etc/passwd
##PROBLEM EXAMPLE
#display problem number
#display command
#run command
#echo whitespace
##PROBLEMS
echo ">PROBLEM 01"
echo "awk '/zzan/ {print}' $W | head" #contains 'zzan'
awk '/zzan/ {print}' $W | head #pipe to head
echo
echo ">PROBLEM 02"
echo "awk '/^[aeiou].*[ou]rch$/ {print}' $W | head" #start w/lowercase vowel
echo awk '/^[aeiou].*[ou]rch$/ {print}' $W | head #end in orch/urch
echo #pipe to head
echo ">PROBLEM 03"
echo "awk '/chevy/ {print}' $C" #display all records
echo awk '/chevy/ {print}' $C #of all chevys
echo
echo ">PROBLEM 04"
echo "awk '$1 ~ /o/ {print}' $C" #display all records
echo awk '$1 ~ /o/ {print}' $C #contains 'o' in column 1
echo
`