Greetingz!
Gee, this sure looks like a homework assignment...what is that data from?
As for "how to do it", you can utilize for-loops and if-then statemens within the Korn shell.
Code:
#! /usr/bin/ksh
export FILE_TO_CHECK=/absolute/path/to/the/filename
export ZERO_IN_FIELD_TWO_PRESENT=0
printf "Scanning $FILE_TO_CHECK\n"
for x in $(awk '{print $2}' ${FILENAME_TO_CHECK} )
do
if [ $x -eq 0 ]; then
printf "There is a zero in field two. File will be emailed out. Continuing scan...\n"
export ZERO_IN_FEILD_TWO_PRESENT=1
fi
done
printf "Scan of $FILE_TO_CHECK completed.\n"
if [ $ZERO_IN_FIELD_TWO_PRESENT -eq 1 ]; then
mailx -s "subject line you want in the email" email@address.to.mail.to
printf "$FILE_TO_CHECK has been emailed.\n"
fi
# End of File.