delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/15/23:15:53

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Mon, 15 Aug 2005 23:15:39 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Herb Martin <HerbM AT learnquick DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Perl v5.8.7, CygWin DLL 1.5.18, script runs differently (hangs) on Cygwin while running open FH, "netsh ...|" or die "..."
In-Reply-To: <EIL7ZYO-00031S-D3@mail2.learnquick.com>
Message-ID: <Pine.GSO.4.61.0508152314180.9560@slinky.cs.nyu.edu>
References: <EIL7ZYO-00031S-D3 AT mail2 DOT learnquick DOT com>
MIME-Version: 1.0

On Sun, 14 Aug 2005, Herb Martin wrote:

> The following test script hangs under CygWin Bash and run
> to completion under Windows (CMD.exe) -- both command lines
> run fine when run from the respective shell prompts (not
> in Perl), even when redirected to a file or piped to another
> command (more, grep, etc.):
>
> #!/usr/bin/perl -w
> open(NETSHARE, "net share |") or die "Can't run net share: $!\n";
> print "we got through the call to 'net share'\n";
> while (<NETSHARE>) {
>   print;
> }
>
> open(IPSEC, "netsh ipsec static show all format=table |") or die "Can't run
> netsh: $!\n";
> print "we got through the call to 'netsh'\n";
> while (<NETSHARE>) {
          ^^^^^^^^
Is there a particular reason you open one filehandle, but read from
another?
	Igor

>   print;
> }
> #################end test script ##################
>
> Is this Perl, Bash, CygWin, or something that I have
> done wrong in the script?

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019