Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bang Executing Perl Scripts
- X-seq: zsh-workers 28650
- From: Klaus Ethgen <klaus+usenet@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Bang Executing Perl Scripts
- Date: Tue, 25 Jan 2011 12:42:04 +0100
- Cancel-lock: sha1:Bg9ThWCthHIx8rORlpbi9XSPagQ=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <Xns9E77D2686F135zzappergmailcom@80.91.229.10> <AANLkTimSXtDjkw2DhfxTHWYPSBPpnwnbjPueC0RS-9qJ@mail.gmail.com> <1246B8BF-933E-4143-9B06-62197CE64B94__21660.9615985819$1295907908$gmane$org@free.fr>
Moin,
François Revol <revol@xxxxxxx> schrieb:
>> Why not putting #!/usr/bin/perl as the first line of your perl scripts?
>
> This is not portable.
Portable enough today. But if you want to support minor OSs like BeOS or
windows ...
> BeOS and Haiku do not have /usr for ex, so perl is elsewhere.
> (and so is env, so using #!/usr/bin/env perl is just moving the problem around)
... look at »perldoc perlrun«:
#!/bin/sh
#! -*-perl-*-
eval 'exec perl -x -wS $0 ${1+"$@"}'
if 0;
There is a pretty good change that /bin/sh is available on relevant
systems. But also for this solution, you cannot support all exotic
systems.
-- Klaus
--
Klaus Ethgen http://www.ethgen.ch/
pub 2048R/D1A4EDE5 2000-02-26 Klaus Ethgen <Klaus@xxxxxxxxx>
Fingerprint: D7 67 71 C4 99 A6 D4 FE EA 40 30 57 3C 88 26 2B
Messages sorted by:
Reverse Date,
Date,
Thread,
Author