this isn't pretty but i'm still learning awk and sed so this the best i could do.
Code:
ipsrc=`ifconfig eth0 | grep 'inet ' | awk -F":" '{print $2}' | awk '{print $1}'`
that will get you the ip address of the machine, like i said it's not pretty
I'm sure there is a better way, but I'm still learning awk and sed.
I think you can get the two awk pipes in to one call to awk but i'm not sure
since they are using two different dilimeters.
also could you be a little more clear on what you are trying to achieve here
why would you want to run a script to shut donw multiple machines, seems to
me like that could be trouble.