delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/12/10/12:45:02

From: richardd AT cix DOT compulink DOT co DOT uk (Richard Donkin)
Subject: Bash/Perl problem
10 Dec 1996 12:45:02 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <memo.413771.cygnus.gnu-win32@cix.compulink.co.uk>
Reply-To: richardd AT cix DOT compulink DOT co DOT uk
Original-To: gnu-win32 AT cygnus DOT com
Original-Cc: richardd AT cix DOT compulink DOT co DOT uk
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Gnu-Win32 B17 Bash will sometimes compete for input from a Perl/Win32 script 
that has been launched in the foreground and finishes with an exec() - Perl 
launches the exec'ed program, but bash thinks the subprocess has terminated 
and starts trying to read command line input.  

This may well be an artefact of how Perl/Win32 build 110 implements its 
exec() function - under Win95's command.com, the script works fine, so it is 
the interaction of bash and Perl/Win32 that causes the problem.  The problem 
occurred when exec'ing VIM 4.5 for Win32 but I don't think that matters, any 
program that asks for input would do.

I will be passing this on to the Perl/Win32 porters but here it is for the 
record.

To reproduce this, here is the script in cut-down form:

#!/usr/bin/perl

eval 'exec perl -S $0 ${1+"$@"}'
        if 0;

# This line works under bash and command.com:
# system ( "c:\\usr\\local\\bin\\vim.exe", @unixpaths);

# This line under bash provokes error
exec ("c:\\usr\\local\\bin\\vim.exe", @unixpaths);

-------
The problem occurs when running the script as 'perl try' or just 'try' from 
bash.

By the way, for any vi users out there, I really recommend looking at VIM - 
it has online help, multiple windows/buffers, command line history and 
editing, filename completion, etc, but is highly vi compatible.  Emacs users 
can ignore this announcement :)  For more details, see:

VIM home page - <URL:http://www.math.fu-berlin.de/~guckes/vim/>

Richard
--
richardd AT cix DOT compulink DOT co DOT uk                http://www.inside-edge.co.uk/
Inside Edge Consultancy           Client/Server and Internet Applications
PGP key from:  pgp-public-keys AT keys DOT pgp DOT net  -or-  http://www.four11.com/

-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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