I'm having problem using my aliases within a a for loop...
Bash....
for server in `[ -f $* ] && cat $* || echo $*`
do
##### Generate the data.....
$server "/usr/openv/volmgr/bin/vmoprcmd -devmon ds -no_format" 2>/dev/null > /home/pubuntu/${server}_drivestatus.txt
$server "/usr/openv/volmgr/bin/vmoprcmd -devmon hs" 2>/dev/null > /home/pubuntu/${server}_hoststatus.txt
##### Now send out the data.....
echo " "
echo "########## ${server} ##########"
echo " "
/bin/sed '1,4d' /home/pubuntu/${server}_hoststatus.txt| grep -iv connection
echo " "
/usr/bin/awk '{print $6, $3, $7, $8, $10, $36}' /home/pubuntu/${server}_drivestatus.txt |awk '{ if (NF > 5) print}'| sort
echo " "
done
I can use my aliases within the script... but not in the for loop...
Any idea's
Thanks....
Joe Despres
Bash....
for server in `[ -f $* ] && cat $* || echo $*`
do
##### Generate the data.....
$server "/usr/openv/volmgr/bin/vmoprcmd -devmon ds -no_format" 2>/dev/null > /home/pubuntu/${server}_drivestatus.txt
$server "/usr/openv/volmgr/bin/vmoprcmd -devmon hs" 2>/dev/null > /home/pubuntu/${server}_hoststatus.txt
##### Now send out the data.....
echo " "
echo "########## ${server} ##########"
echo " "
/bin/sed '1,4d' /home/pubuntu/${server}_hoststatus.txt| grep -iv connection
echo " "
/usr/bin/awk '{print $6, $3, $7, $8, $10, $36}' /home/pubuntu/${server}_drivestatus.txt |awk '{ if (NF > 5) print}'| sort
echo " "
done
I can use my aliases within the script... but not in the for loop...
Any idea's
Thanks....
Joe Despres