![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| passing variable from bash to perl from bash script | arsidh | Shell Programming and Scripting | 10 | 06-04-2008 12:25 PM |
| what is wrong with this script? | rs1969 | UNIX for Dummies Questions & Answers | 2 | 11-15-2007 07:16 AM |
| What's wrong with this script | amitg1980 | Shell Programming and Scripting | 3 | 11-12-2007 07:00 PM |
| Bash passes flags to shell wrong | andyj | Shell Programming and Scripting | 7 | 07-07-2003 03:01 PM |
| What is wrong with my script? | Lem2003 | UNIX for Dummies Questions & Answers | 6 | 05-29-2003 01:17 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
what's wrong with my bash script?
hi,
please point out what's wrong with my script. im feeding it a list containing fqdn, sit should ssh into each and verify that atleast one of its virtual backup ip resolves into one of its virtual hostnames .. anyway the objective shows in the script... however, im having problems in the innermost if condition.. "else" wont get executed. Code:
#!/bin/bash -x
for i in `cat $1`
do
_HOSTNAME=`echo $i |cut -d"." -f1`
/usr/bin/ssh $i "
echo $_HOSTNAME;
for i in `/sbin/ifconfig -a | grep 172\.39 | awk '{print $2}'`
do
if [[ -n `nslookup $i | grep $_HOSTNAME | awk '{print $2}'` ]]
then echo "backup interface OK"
else echo "backup interface NOT OK"
fi
done
" >> $1.out 2>/dev/null
done
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|