Re: '!#' script interpreter convention ...
From: Kevin Collins (spamtotrash_at_toomuchfiction.com)
Date: 04/29/03
- Next message: Steve Barge: "detect if background process in ksh"
- Previous message: Rich: "Re: bash Shell behaving weird"
- In reply to: Saurabh Verma: "Re: '!#' script interpreter convention ..."
- Next in thread: Wartan Hachaturow: "Re: '!#' script interpreter convention ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 29 Apr 2003 14:36:09 -0700
saurabh_verma78@yahoo.com (Saurabh Verma) wrote in message news:<58c50fc8.0304291048.50972180@posting.google.com>...
> Thanks John.
> Do, you know of any good way to run a this kind of script on different
> machines with different perl paths. With me, the issue is, on some
> machines perl is in 'usr/local/bin' and on some other its in 'usr/bin'
> so, my script fails on one of these. And the way i am using it, i
> can't run 'perl test.pl', as i need to run 'test.pl' only(as
> executable).
> Thanks,
> Saurabh
>
>
--SNIP--
See the perlrun man page... Here is a useful snippet:
Parsing of the #! switches starts wherever "perl" is mentioned in the
line. The sequences "-*" and "- " are specifically ignored so that
you could, if you were so inclined, say
#!/bin/sh -- # -*- perl -*- -p
eval 'exec perl -wS $0 ${1+"$@"}'
if $running_under_some_shell;
to let Perl see the -p switch.
Kevin
- Next message: Steve Barge: "detect if background process in ksh"
- Previous message: Rich: "Re: bash Shell behaving weird"
- In reply to: Saurabh Verma: "Re: '!#' script interpreter convention ..."
- Next in thread: Wartan Hachaturow: "Re: '!#' script interpreter convention ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|