in reply to How to use dynamic execution path instead of absolut.
On Unix system the following should work:
The backticks execute the found perl.
The -x switch forces perl to skip everything before #!perl
$0 is the scriptname.
$* are all commandline parameters.
which finds (hopefully) your perl.#!/bin/sh `which perl` -x $0 $* exit #!perl print "hello perl\n";
The backticks execute the found perl.
The -x switch forces perl to skip everything before #!perl
$0 is the scriptname.
$* are all commandline parameters.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to use dynamic execution path instead of absolut.
by Aristotle (Chancellor) on Jan 14, 2003 at 10:41 UTC | |
by busunsl (Vicar) on Jan 14, 2003 at 11:59 UTC | |
•Re: Re: How to use dynamic execution path instead of absolut.
by merlyn (Sage) on Jan 14, 2003 at 17:44 UTC |
In Section
Seekers of Perl Wisdom