Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Early termination of STDIN with combination of ssh and sleep

by Crackers2 (Parson)
on Dec 25, 2013 at 03:25 UTC ( #1068345=note: print w/replies, xml ) Need Help??


in reply to Early termination of STDIN with combination of ssh and sleep

Does it work if you change the exec to

die "Unable to exec\n" unless(exec("/usr/bin/ssh localhost /bi +n/sleep 10 </dev/null"));

or

die "Unable to exec\n" unless(exec("/usr/bin/ssh -n localhost +/bin/sleep 10"));

IIRC ssh may be pre-reading STDIN and then discarding the contents when it's not actually needed. Redirecting stdin for the ssh command makes sure there won't be any interference with your main program.

Replies are listed 'Best First'.
Re^2: Early termination of STDIN with combination of ssh and sleep
by orleans704 (Initiate) on Dec 25, 2013 at 12:34 UTC
    Wow, that did the trick. Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1068345]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2020-10-24 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (246 votes). Check out past polls.

    Notices?