Re: '!#' script interpreter convention ...

From: Kevin Collins (spamtotrash_at_toomuchfiction.com)
Date: 04/29/03


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



Relevant Pages

  • Re: !# script interpreter convention ...
    ... you know of any good way to run a this kind of script on different ... machines with different perl paths. ...
    (comp.unix.shell)
  • Re: Roadshows, Part V
    ... each of the "skits" with John and Miles, there was a part where Miles ... script with cues for the lights and sound folks. ... "Listen, you know I really dig that Priscilla chick, right?" ...
    (soc.religion.mormon)
  • lk-changelog.pl 0.325
    ... This script is used by Linus and Marcelo to rearrange and reformat BK ... +'christoph:lameter.com' => 'Christoph Lameter', ... 'hawkes:oss.sgi.com' => 'John Hawkes', ... 'lethal:unusual.internal.linux-sh.org' => 'Paul Mundt', ...
    (Linux-Kernel)
  • Re: Automating password change
    ... All the machines are set up differently from each other ... > use telnet, others I can rlogin or remsh, and still others I can ssh. ... it would not be practical to try to write a complex script ... > to write a simple script to wrap around passwd that would run on each ...
    (comp.unix.solaris)
  • Re: Automating password change
    ... All the machines are set up differently from each other ... > use telnet, others I can rlogin or remsh, and still others I can ssh. ... it would not be practical to try to write a complex script ... > to write a simple script to wrap around passwd that would run on each ...
    (comp.unix.shell)