[Top][All Lists]

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

Re: Hash-bang line length

From: Chet Ramey
Subject: Re: Hash-bang line length
Date: Wed, 13 Jan 2016 11:23:34 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 1/13/16 9:04 AM, Greg Wooledge wrote:
> On Wed, Jan 13, 2016 at 02:52:08PM +0100, Ludovic Courtès wrote:
>> Sure, but the fact that it???s smaller than that of the kernel Linux is
>> problematic: when a hash-bang line > 127 chars is encountered, ???execve???
>> fails with ENOENT, so Bash???s fallback code is executed, fails as well,
>> but it prints a misleading error message with an even more truncated
>> hash-bang line.
> Let's suppose bash is changed to read a shebang line of unlimited length.
> In your scenario, the script with the 150 character shebang fails at the
> kernel level with ENOENT, so bash's fallback code runs, and the script
> is executed by a new instance of bash.

No, it isn't.  The execve fails with ENOENT, so bash just prints an error
message containing the interpreter name, which Ludo is reporting is

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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