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

Re: #! syntax



Quoting Anthony Fox (ant@lonelyroad.org):
> "Michael O'Brien" <mobrien@pixar.com> writes:

> > 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.

I missed the original posting. I have a similar problem with
perl, python etc. at work on a Sun. My solution is to put
#!/usr/bin/env python
on all my scripts, in place of
#!/usr/bin/python
because their python is in /usr/local/bin.

Cheers,

-- 
Email:  d.wright@open.ac.uk   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.



Reply to: