public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Tian You <youtian001@gmail.com>
To: cygwin@cygwin.com
Subject: Ask for help on running interactive cmd in Mintty!
Date: Wed, 20 Jun 2012 07:16:00 -0000	[thread overview]
Message-ID: <CAKeUZfyjvJm08KveF4bVpWW7FORi5OHi8g_zH4rvJ2FPQFm9pQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2012-06-20  7:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-20  7:16 Tian You [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKeUZfyjvJm08KveF4bVpWW7FORi5OHi8g_zH4rvJ2FPQFm9pQ@mail.gmail.com \
    --to=youtian001@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).