help on if loop within ssh



Hi Guru's

Please help on the following simple script... if loop in there
doesn't seems to work ... am i missing something here...

for i in `cat sev_list`
do
echo "$i ---Started"
ssh root@$i "/usr/sbin/useradd -u 10536 -g uss -c \"test user\" -d
/export/home/oko01 -m -s /bin/ksh oko0
1;if [ -f /usr/bin/passwd.orig ]\
then\
/usr/bin/passwd.orig oko01\
else\
/usr/bin/passwd oko01\
fi"
echo "$i --Finished"
done


Best Regards
__________________________________________________________
Kumaresh. P. N
__________________________________________________________
_______________________________________________
sunmanagers mailing list
sunmanagers@xxxxxxxxxxxxxxx
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



Relevant Pages

  • RE: Script help needed...
    ... I believe that the problem is that the `cat | while` syntax starts a sub-shell, changing the scopes of the variables. ... I'm writing a script that I am going to use to test write data to an nfs ... while loop and it is null outside the loop even after it is set. ... # Read PIDFILE and determine if script is already running. ...
    (RedHat)
  • Re: Piping within for-loops
    ... >>I want to write a script, that selects words from a wordlist, ... > it looks to me like your script will only loop once anyway. ... then cat "$DICT" ...
    (comp.unix.shell)
  • Re: seperating parametrs in loop other then space
    ... Suppose you have a while read loop in a small self sufficient script, ... cat is the man for the job. ... nonstandard features. ...
    (comp.unix.shell)
  • cat multiple values to while read a b
    ... I'm trying to send multiple values to a while read loop, ... success with either cat or echo. ... There is one way which works, but it would make my script completely ...
    (comp.unix.shell)
  • scripting fun
    ... for i in `cat ~/temp/newaddresses.txt` ... The command line of join... ... something near the parenthesis and that causes it to stop the script. ... Trying \ didn't seem to help so I am probably missing something obvious. ...
    (Ubuntu)