public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Ask for help on running interactive cmd in Mintty!
@ 2012-06-20  7:16 Tian You
  2012-06-20 11:14 ` Earnie Boyd
  0 siblings, 1 reply; 13+ messages in thread
From: Tian You @ 2012-06-20  7:16 UTC (permalink / raw)
  To: cygwin

Hi All

I'm running a perl program like this:

## script start ##
print "Please input:";
my $input = <STDIN>;
chomp $input;

system("ssh to a remote machine to run an command");
print "done\n";
## script done ##

But after I input something and press enter, I can not see the output
of the ssh command.
Only after I press any key, the output flushes out to the screen.
Is the output buffered? But why it flushed after I press any one key?

What is stranger is, if I remove the read STDIN line, and just run the
system("ssh ..."), lI can see the output of ssh command at once.
The script is like this:

## script start ##
#print "Please input:";
#my $input = <STDIN>;
#chomp $input;

system("ssh to a remote machine to run an command");
print "done\n";
## script done ##

Anyone can help on this?

Regards,
Tian

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-06-26 11:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-20  7:16 Ask for help on running interactive cmd in Mintty! Tian You
2012-06-20 11:14 ` Earnie Boyd
2012-06-20 15:07   ` Tian You
2012-06-20 15:44     ` Earnie Boyd
2012-06-20 16:05       ` Tian You
2012-06-20 16:15         ` Tian You
2012-06-20 17:45         ` Earnie Boyd
2012-06-21  1:12           ` Tian You
2012-06-21 11:27             ` Earnie Boyd
2012-06-25  0:50               ` Tian You
2012-06-25 10:51                 ` Earnie Boyd
2012-06-26  7:50                   ` Tian You
2012-06-26 11:14                     ` Earnie Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).