When I commment out the 'if ($status != 0)then' and it's relative 'endif'
line, the script runs fine. (Of course, it doesn't skip the nodes running
NIS) Any ideas would be appreciated, this is driving me nuts! :)
Thanks in advance.
Larry Pisani
========================================================================
This is the script:
-------------------
#!/bin/csh
#
diff /etc/passwd /master/etc/passwd >/tmp/up.pass
grep bin /tmp/up.pass >/dev/null
if ($status == 0)then
/master/scripts/update_nis_pw.sh
cp /etc/passwd /master/etc/passwd
foreach node (`cat /master/scripts/node_list`)
remsh $node ypwhich | grep 'srv'
if ($status != 0)then
rcp /master/etc/passwd $node\:/etc/passwd
endif
end
endif
rm /tmp/up.pass
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=========================================================================
error message:
--------------
end: Not in while/foreach.
remsh "$node" ypwhich | grep 'srv'
> if ($status != 0)then
> rcp /master/etc/passwd $node\:/etc/passwd
> endif
> end
> endif
> rm /tmp/up.pass
-/-
> error message:
> --------------
>
> end: Not in while/foreach.
Good luck,
Marcel
--
____ __ . . __
| | | |_ |_| | | mailto:me...@nlr.nl tel: +31 20 5113495
| | | |__ _| | | National Aerospace Laboratory NLR fax: +31 20 5113210