This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: bash won't hand off to perl (reprise)
- To: JP Shipherd <jp at nuancecom dot com>, gnu-win32 at cygnus dot com
- Subject: Re: bash won't hand off to perl (reprise)
- From: Stephen Williams <steve at icarus dot icarus dot com>
- Date: Thu, 27 Mar 1997 22:21:23 -0800
jp@nuancecom.com said:
> I posted a while back complaining that bash.exe wouldn't hand off to
> the right command interpreter even if the shell script started with
> something like:
#!/usr/local/bin/perl
jp@nuancecom.com said:
> However, the following still does not work:
%> /bin/sh perl-script.pl
jp@nuancecom.com said:
> In this case bash still tries to process the file as if it is a
> bourne shell script.
As it should. The '#' character marks a comment for bourne shell, so is
ignored. And anyhow, /bin/sh does not and should not check the magic number
of a file to see if it an a.out or coff or whatever, it accepts a text file.
However, it you try:
/bin/sh -c ./perl-script.pl
Then you will get what I think you are trying to achieve. Notice the -c switch,
which tells sh to interpret this as a command, and so pass the perl-script.pl
file to exec(2), which is where the magick numbers are examined and the
correct interpreter selected.
'k?
--
Steve Williams
steve@icarus.com
steve@picturel.com
"The woods are lovely, dark and deep. But I have promises to keep,
And lines to code before I sleep, And lines to code before I sleep."
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".