From: richardd@cix.compulink.co.uk (Richard Donkin)
Subject: Bash/Perl problem
10 Dec 1996 12:45:02 -0800
Sender: daemon@cygnus.com
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <memo.413771.cygnus.gnu-win32@cix.compulink.co.uk>
Reply-To: richardd@cix.compulink.co.uk
Original-To: gnu-win32@cygnus.com
Original-Cc: richardd@cix.compulink.co.uk
Original-Sender: owner-gnu-win32@cygnus.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@cix.compulink.co.uk                http://www.inside-edge.co.uk/
Inside Edge Consultancy           Client/Server and Internet Applications
PGP key from:  pgp-public-keys@keys.pgp.net  -or-  http://www.four11.com/

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