From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9515 invoked by alias); 20 Jun 2012 07:16:30 -0000 Received: (qmail 9507 invoked by uid 22791); 20 Jun 2012 07:16:29 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-vc0-f171.google.com (HELO mail-vc0-f171.google.com) (209.85.220.171) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Jun 2012 07:16:16 +0000 Received: by vcbgb30 with SMTP id gb30so4151945vcb.2 for ; Wed, 20 Jun 2012 00:16:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.174.164 with SMTP id bt4mr978636vdc.26.1340176575997; Wed, 20 Jun 2012 00:16:15 -0700 (PDT) Received: by 10.220.37.71 with HTTP; Wed, 20 Jun 2012 00:16:15 -0700 (PDT) Date: Wed, 20 Jun 2012 07:16:00 -0000 Message-ID: Subject: Ask for help on running interactive cmd in Mintty! From: Tian You To: cygwin@cygwin.com Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-06/txt/msg00350.txt.bz2 Hi All I'm running a perl program like this: ## script start ## print "Please input:"; my $input = ; 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 = ; #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