This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Perl v5.8.7, CygWin DLL 1.5.18, script runs differently (hangs) on Cygwin while running open FH, "netsh ...|" or die "..."


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@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]