Subject: Re: B.20.1 bash question - paths sent to #!
From: [email-masked] (Michael Hirmke)
To: [email-masked]
Date: 02 Feb 2000 22:20:00 +0200

Hi Al,

[...]
>I have 3 drives on my NT 4.0 system: C: D: E:.
>I have a perl script that has "#!/usr/bin/perl" in it.
[...]
>I am using ActiveState Perl.

I don't use AS Perl, but compiled the sources with VC++ myself.
So my configuration here is comparable to your's.

>
>Here is the situation.  First, my perl script is called "pop3", and it
>resides in /e/perl/bin.  If I put /e/perl/bin in my path, then I believe

I always have a shebang like "#!/usr/bin/perl -w" in all my perl
scripts.
I always add the directories containing my perl scripts to the path.

>that bash calls /usr/bin/perl with the file name as /e/perl/bin/pop3.
>However, AS Perl can't interpret this file name and gives a "file not found"
>error.
>
>I tried putting /perl/bin/ in my path, and this works, as long as I am "on"
>the e drive.  When I go to another drive, /perl/bin does not exist, and
>calling pop3 fails again.

You *have to* call your scripts with "perl -S
<scriptname_without_path>", even if you have added the directory to the
path.
If you don't want to do this, you would have to use the Cygwin version
of perl, which lacks a few very important modules, though.

>
>So what I'd like is to have bash convert the Posix path of the called script
>to win32 when using the #! syntax, so that AS Perl (and other interpreters)
>will have a path it can work with.  Is there a workaround?

You could write some wrapper script perhaps.

>
>I hope this makes sense.  Let me know if can clarify.
>-----------------
>Al and Patricia

Bye.
Michael.
-- 
Michael Hirmke           | Telefon +49 (911) 557999
Georg-Strobel-Strasse 81 | FAX     +49 (911) 557664
90489 Nuernberg          | E-Mail  mailto:[email-masked]
                         | WWW     http://aquarius.franken.de/

--
Want to unsubscribe from this list?
Send a message to [email-masked]