[SLL] script interpreter bootstrap tricks

Ted Stern dodecatheon at gmail.com
Tue Apr 1 14:18:31 PDT 2008


On 01 Apr 2008 14:01:51 -0700, Ted Stern wrote:
>
> On 01 Apr 2008 13:04:30 -0700, Brian Hatch wrote:
>>
>> Pretty near to 2008-04-01 11:49 -0700, Ted Stern uttered:
>>
>>> Everyone knows that you start a vanilla Bourne shell script with a
>>> shebang:
>>> 
>>>          #!/bin/sh
>>> 
>>> But what do you do if you want to interpret the script with some tool,
>>> like perl, python, tclsh or even bash, that is either not installed in
>>> /bin or is not listed in /etc/shells?  And it may not be located in
>>> the default path, so "#!/usr/bin/env <utility>" won't work.
>>
>>
>> Sometimes there are too many problems you're working around, and need
>> to fix the problem.
>>
>> Is adding the directory to your path s.t. #!/usr/bin/env really
>> not an acceptable solution?
>
> I'll have to petition the admins on the oddball system to allow it in
> /etc/shells.
>

Brian, one other thing ... I've noticed that /usr/bin/env does not
allow extra options when starting bash.  For example,

   #!/usr/bin/env bash -p

does not work, but 
     
   #!/usr/bin/env bash

does.  So the bootstrap option is still attractive in one respect.

Ted
-- 
 dodecatheon at gmail dot com
 Frango ut patefaciam -- I break so that I may reveal


More information about the linux-list mailing list