[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: #! syntax

On Mon, Feb 26, 2001 at 08:22:34AM -0800, Michael O'Brien wrote:
> Hola~
> Is there any way to have a #! syntax that will conditionally run a interpreter
> based on a set of fallback locations?
> For example, we have a perl install in /dir/bin/perl. However, if you are at a
> non-work machine (ie, at home), you may not have a /dir/bin/perl. So, I'd like
> to have a script that will first try /dir/bin/perl, then if that doesn't
> exist, tries /usr/bin/perl.

You could consider:

   #!/usr/bin/env perl

as more installs will have env in the same place.

groetjes, carel

Reply to: