The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-18-2009
Andyp2704's Avatar
Andyp2704 Andyp2704 is offline
Registered User
  
 

Join Date: Mar 2009
Location: Ripponden, West Yorkshire
Posts: 18
While Read problem

Hello,

I have this simple script

while read name
do
ssh $name "hostname > /tmp/$name.txt"
ssh $name "/opt/ignite/bin/print_manifest | grep Main >> /tmp/$name.txt"
ssh $name "getconf MACHINE_SERIAL >> /tmp/$name.txt"
ssh $name "ioscan -kfnC processor | grep processor | wc -l >> /tmp/$name.txt"
ssh $name "getconf MACHINE_MODEL >> /tmp/$name.txt"
ssh $name "uname -a >> /tmp/$name.txt"
ssh $name "scp /tmp/$name.txt marques:/home/pilga/$name.txt"
ssh $name "rm /tmp/$name.txt"
done < /home/pilga/man_blade.txt


And the file to read the names from is this;

anderson
albers
amon
acheson
doornbos
daigh
drogo
donnelly
revson
boutsen
danner
dalmas
modena
moss
massa
montoya

When i run this script it reads the first name (anderson) but once it has done all the ssh commands it just exits out and does not go to the next line........Guess i have made some obvious error but i cannot see it....