bug-bash
[Top][All Lists]
Advanced

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

Re: feature request: option to start script not from the very beginning


From: Clark J. Wang
Subject: Re: feature request: option to start script not from the very beginning of file
Date: Wed, 3 Aug 2011 10:11:37 +0800

On Tue, Aug 2, 2011 at 10:34 PM, Steven W. Orr <address@hidden> wrote:

> On 8/2/2011 9:05 AM, Dmitry Bolshakov wrote:
>
>> hi
>>
>> perl has "-x" switch which makes it skip leading file contents until the
>> #!/bin/perl
>> line
>>
>> imho it would be good to have the same feature in bash
>>
>>
> Huge misteak. The shebang is processed by the exec system call.


Only true when a script, e.g. foo.sh, is invoked by ``./foo.sh''. What
Dmitry wants is a new option, say ``--perl-x'', and he wants to invoke the
script by ``bash --perl-x foo.sh''.

You can take a look at Perl's ``-x'' explanation. I like that. :-)


> As such, it must occupy the first 16 bits of the file. The #! is the magic
> number that makes it work. What possible value is there in subverting a
> perfectly good system call?
>
> --
> Time flies like the wind. Fruit flies like a banana. Stranger things have
>  .0.
> happened but none stranger than this. Does your driver's license say Organ
> ..0
> Donor?Black holes are where God divided by zero. Listen to me! We are all-
> 000
> individuals! What if this weren't a hypothetical question?
> steveo at syslang.net
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]