[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shebang length limits
From: |
Chet Ramey |
Subject: |
Re: shebang length limits |
Date: |
Fri, 05 Sep 2014 08:59:44 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 9/5/14, 8:26 AM, The Wanderer wrote:
> While that does address the question of what the actual length limit is,
> it doesn't address the mismatch I saw in the error message which
> occurred when the path was too long. Does that error, and the associated
> mismatch, in fact originate from within bash?
Yes. All the kernel gives you is -1/errno (the worst is ENOENT).
Rather than print the confusing error message associated with these errno
values, I added the getinterp() logic in an earlier version of
(bash-2.05) to provide more useful information.
> If so, any chance of getting the mismatch fixed, so that the shebang
> printed when the path is too long is at least the full truncated length
> of what was actually searched for rather than only the leading portion
> of that path?
You have to have some length limit, and 80 has been historically
reasonable. There is no manifest constant available everywhere -- as
you've seen if you've looked at Sven's page -- that provides the correct
limit.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/