Hello all,
I have a script that has an infile with system package information. For the most part the script is looking well. The only thing i need help is in testing for null entries and removing null data.
#!/usr/bin/ksh
for i in `cat /mwncps/bin/eco_pack`
do
NAME=`pkginfo -l | grep $i | grep 'NAME' | awk '{ print $5 }'`
VER=`pkginfo | grep $i | grep version | awk 'BEGIN {OFS=" "}{gsub(/version:/,"") ;}{ print $7 }'`
echo "`hostname`,"$NAME","$VER""
done
The output now looks like this
hostname,,
hostname,,
hostname,package,version <-- this part of the output is correct
hostname,package,version
hostname,package,version
hostname,package,version
hostname,, <-- this will need to be removed completely
hostname,,
I welcome your feedback
Regards,
Al