[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: feature request: option to start script not from the very beginning
Clark J. Wang
Re: feature request: option to start script not from the very beginning of file
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:
>> perl has "-x" switch which makes it skip leading file contents until the
>> 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
> happened but none stranger than this. Does your driver's license say Organ
> Donor?Black holes are where God divided by zero. Listen to me! We are all-
> individuals! What if this weren't a hypothetical question?
> steveo at syslang.net