LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author]
  From: Tim.Wundke@camtech.com.au
  To  : Paul Schulz <pauls@caemrad.com.au>
  Date: Thu, 5 Nov 1998 14:59:03 +1030 (CST)

Re: Bash scripting problem..

On  5 Nov, Paul Schulz wrote:
> Hopefully someone out there knows..
> 
> When placing a bash script from the bash shell into background, 
> with the stdout piped to a file.. why does the script stop and ask for 
> user input? (I don't think that it's this particular script in 
> question as it happens for other scripts as well...)

[snip]

> #!/bin/bash
> 
> SERVERS=`ypmatch servers netgroup | sed 's/(\([^,]*\),[^)]*)/\1/g'`
> for HOST in $SERVERS
> do
>     while true
>     do
> 	for HOST in $SERVERS
> 	do  
> 	    echo -n "$HOST: " `date` " "
> 	    rsh $HOST uptime

If you use "rsh -n $HOST uptime" it should work.  The -n option simply
tells rsh to redirect stdin to /dev/null, fixing your problem.

Tim.

-------------------------------------------------------------------------
Tim Wundke                                     Phone:    +61 8 8303 6077
Analyst/Programmer - Electronic Commerce       Fax:      +61 8 8303 4403
Camtech SA Pty Ltd                             http://www.camtech.com.au

     --- Level 8, 10 Pulteney Street Adelaide SA 5000, Australia ---
-------------------------------------------------------------------------

-- 
Check out the LinuxSA web pages at http://www.linuxsa.org.au/
To unsubscribe from the LinuxSA list:
  mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject


Index: [thread] [date] [subject] [author]
Return to the LinuxSA Mailing List Information Page