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

Re: how execute a script



On Tue, Nov 17, 2015 at 3:24 PM,  <tomas@tuxteam.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Tue, Nov 17, 2015 at 03:15:21PM -0500, shawn wilson wrote:
>> >  % file t.sh
>> > t.sh: ASCII text
>> >  % cat t.sh
>> > max=10
>> >
>>
>> Oh and before someone says "but there's some standard that says you're
>> supposed to put a shebang at the top" - afaik, it's not in POSIX
>> anywhere:
>> http://www.in-ulm.de/~mascheck/various/shebang/
>
> You forgot to mention that it's in AT&T Unix since 1979. I'd venture to
> say that nowadays it is an integral part of Unix.
>

Merely pointing out it's not a spec. But yeah, it's older than me :)

>> So, magic dropped the ball - should've been identified as a shell
>> script (due to the use of "echo"
>
> Now you lost me.
>

If magic were smarter (was able to derive from syntax or had regex
capability in the format), it could've still told me I was looking at
a script (and not just a bunch of text - which is next to useless). It
doesn't, so arguing that magic could be used (not an argument I've
seen, but one I was expecting and figured I'd preempt) instead of an
extension is lacking.


Reply to: