Comparing two variables
--------------------------------------------------------------------------------
Script
#!/bin/sh
hardware=PC
os=WindowsNET
for i in `cat newservers`
do
x=`sudo /opt/openv/netbackup/bin/admincmd/bpplclients |grep $i |head -40 |grep $i|awk '{print $3;exit}'`
if [ "$i" -eq "$x" ]
then
echo "$i is already added"
else
echo "Need to add"
fi
done
O/p in debug mode
bash-2.05$ sh -x server_test.sh
hardware=PC
os=WindowsNET
+ cat newservers
+ sudo /opt/openv/netbackup/bin/admincmd/bpplclients
+ grep ds01smspsbby
+ head -40
+ awk {print $3;exit}
+ grep sun
x=sun
+ [ sun -eq sun]
sun is already added
+ sudo /opt/openv/netbackup/bin/admincmd/bpplclients
+ grep pluto
+ head -40
+ awk {print $3;exit}
+ grep pluto
x=
pluto is already added
for both conditions its showing the same output.Can soomeone correct this script?
Thanks,
Rajeswari