[Top][All Lists]

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

Re: suggestions: for bash shell: "shebam's and shebang's"

From: L A Walsh
Subject: Re: suggestions: for bash shell: "shebam's and shebang's"
Date: Wed, 11 Jan 2017 18:04:33 -0800
User-agent: Thunderbird

Greg Wooledge wrote:
On Wed, Jan 11, 2017 at 01:30:02PM -0500, Bill William wrote:
The problem with the shebang is that its not a file type its an
executable...what is needed is the option to only specify a file type...
//Example Shebang:       #!/usr/bin/perl
//Example Shebam:        #:utf8
You are missing a key piece of information: it's not bash who reads and
acts upon the shebang.  It's the kernel.  To bash, it's just a comment.
   True.  I was thinking about whether or not a given interpreter
might want to read another comment, say on a 2nd line, to determine
some other info -- but even there, in languages like perl, if you have
utf8 in your code, the "perl way" of doing it would be to use
"use utf8" at or near the top of the file (before you use any utf8 chars).

Getting everyone to change would be a lot more than a
than getting 1 place to change.  You'd have all the langs,
(of which there are probably 100's)... With gtk+xml+gladed6
you are getting awfully close to mime-types.  The file-command
is pretty good about identifying the encoding used and/or
spitting out the mime-type.  (Try running file in your
home dir -- or to see the mime types, use "-i" or
--mime to get the mime-type and mime-encoding (type and encoding
are two separate things -- another 'gotcha').

If you had it in the header, what's the usage case?  There are
docs that have the encoding and such at the top -- web-docs --
they have it 1st thing so clients can interpret the rest of the doc,
but humans don't use it -- it's automatically done by your
web browser.  So how would you use a mime-type field at the beginning
of files?  The humans are as likely, as not to delete those
'junk' lines at the top (especially if they don't know what they
are for)...

Does that give you an idea of the usefulness vs. amount of
work to get everyone to do/accept it?  :-)

Good idea though -- it's worked out reasonably well on
web docs.


reply via email to

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