watergrinder
MIS
Code:
write header to file
connect sqlplus spool to sqltemp
cat $sqltemp | awk '{print $1, $2, $3}' | while read x y z
do
if something then
write output to file
fi
done
Here I would like to print header before output in a file. It should be written only if there is sqlplus output. it can't be put in loop because it repeats. Is there a way to know if cat found data in sqltemp file?