Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time out value for RSH or an alternative...

Status
Not open for further replies.

search66

IS-IT--Management
Apr 17, 2002
198
US
I'm using a UNIX server (SCO) to RSH into a Windows 2000 workstation... I want to run a script that deletes two directories and then go to the next workstation.

This is what I have now, but if for some reason the file is is use or not responding; the 'script' hangs. I'm wondering if anyone knows of a way to cause the script to timeout and move on to the next wrks...

Here is the script I have... Appreciate the help.

for x in `nt_list`;do echo $x;rsh $x "rm -rf c:\docume~1\level2 c:\docume~1\level3";done
 
You're trying to execute an "[tt]rm[/tt]" command on a Windows machine. I don't think that's a valid command in Windows. Shouldn't it be a "[tt]RD[/tt]" or "[tt]RMDIR[/tt]"?
 
You can also add a test to see if the directory is there first. Something like...
Code:
for x in `nt_list`
do
    echo $x
    rsh %x "if exist c:\docume~1\level2 rd /s c:\docume~1\level2"
    rsh %x "if exist c:\docume~1\level3 rd /s c:\docume~1\level3"
done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top