I have a script that uses several awk one liners to manipulate data. Does it make sense to have several awk programs in one shell script, or is it always possible to combine the awk programs?
Example:
Does it make sense to try to combine the above awk statements?
Example:
Code:
#Running bperror to get data
/usr/openv/netbackup/bin/admincmd/bperror -backstat -l -d ${sdate} -e ${sdate} | \
#Reverse output
awk '{store[NR]=$0}END{if(i=NR;i>=1;i--)print store[i]}' | \
#Getting Unique Entries
awk '{time=$1;client=$12;policy=$14;sched=$16;status=$19}!/Unable/{print time,client,policy,sched,status}'| \
awk '!x[$2,$3,$4]++' | \
#Filter Out Errors
awk '$5>1 && $5!=150 && $5!=191' | sort +4
Does it make sense to try to combine the above awk statements?