Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TOPIC] What does the shebang really do?
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10085
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Mar 30, 2018 3:27 pm    Post subject: Reply with quote

Khayyam's statement seems clear and meaningful to me, but can be modestly clarified. What khayyam meant was that non-POSIX "bashisms" are accepted by bash even when it's in --posix mode. Therefore, if your goal is strict POSIX compatibility, testing under bash is problematic.

Don't get too defensive. Technical people often jump on statements that are ambiguous or not wholly or strictly correct. This is a good thing because precision of language is important in technical endeavors. Also, we can all be better, learn things, right?

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Fri Mar 30, 2018 3:49 pm    Post subject: Reply with quote

@John R. Graham: the POSIX mode does not exist to test conformance to the POSIX standard. It is the designers who do this work.
This mode allows a POSIX compliant script to be executed (POSIX: Portable Operating System Interface for Unix).
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10085
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Mar 30, 2018 4:00 pm    Post subject: Reply with quote

I'm afraid you're missing the point. POSIX compliant scripts will generally work in bash without specifying --posix mode. This command line option just covers some abstruse corner cases.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Fri Mar 30, 2018 4:17 pm    Post subject: Reply with quote

@John R. Graham: I assume that nobody currently uses (or consider) a Bourne Shell (sh) so my statements are still correct.

helecho wrote:
GNU Bash runs in POSIX mode if the shebang is /bin/sh [...]


info bash wrote:
6.11 Bash POSIX Mode

When invoked as `sh', Bash enters POSIX mode after reading the startup file.


helecho
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10085
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Mar 30, 2018 4:59 pm    Post subject: Reply with quote

I'm afraid you're still missing the point. I'm also afraid that I've piled on and will now have to split this thread.

If you care to, take a look at what the OP actually asked about. Comments on what bash does and doesn't do with the shebang are essentially irrelevant to this thread. Certainly they're off topic.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Fri Mar 30, 2018 5:06 pm    Post subject: Reply with quote

I bow! :D
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5433
Location: Removed by Neddy

PostPosted: Fri Mar 30, 2018 6:19 pm    Post subject: Reply with quote

helecho wrote:
@Naib @khayyam: your declarations are dissapointing and disrespectful: it seems to you equal that the interlocutor has a good faith; you advocate an offensive approach.
how? have you spontaneously contracted leprosy or something?
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6061
Location: Room 101

PostPosted: Fri Mar 30, 2018 7:40 pm    Post subject: Reply with quote

helecho wrote:
@Naib @khayyam: your declarations are dissapointing and disrespectful: it seems to you equal that the interlocutor has a good faith; you advocate an offensive approach.

helecho ... whatever you mean by that (as it's unclear how anyone should get from the proposition to the conclusion) I don't consider it fair criticism. As I said, you're not actually engaging with what's presented, specifically WRT to the point Hu was making, and so it seems right that this is pointed out. It also doesn't help that you consistently use english as though it's Scrabble (meaning that you get a higher meaning/score based on the words used), this isn't the case, english relies very much on tight relations between words/statements, and expressivity (or vagueness) isn't a substitute for that.

helecho wrote:
@khayyam: GNU Bash supports more features than a POSIX shell but is a POSIX capable shell. The documentation explicitly states what differs concerning POSIX features.

You are shifting the goalposts, my question was: in what way can it be said that "bash properly considers the shebang because it adapts its operations"? As I showed, it clearly doesn't, so any argument to the tune of "bash [...] is a POSIX capable shell" means nothing here.

helecho wrote:
My statement you have previously quoted is not a criticism but a comment supporting my previous posts. My words as you interpret them are meaningless because you distort them.

No, I didn't "distort" them, it's just that you're continuing to ignore the gist of Hu's point, and that is what what your "previous posts", and the statement "bash properly considers the shebang", was supposedly countering.

helecho wrote:
I would even say your statement is meaningless: "non POSIX "bashisms" are accepted by Bash" (see below). Stop fantasizing: I will not certify anything and certainly not POSIX!

That would be meaningless if it were not the case that we were explicitly speaking about '--posix' and/or "POSIX mode if the shebang is /bin/sh". Your argument seems to be that because bash can interpret posix sh therefore it is '--posix', when in fact it's bash, because '--posix' makes no difference. That is, for the most part, a trivial distinction, but it's relevant in this discussion because that is what Hu was pointing out ... and you were completely ignoring!

best ... khay
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6814

PostPosted: Fri Mar 30, 2018 8:07 pm    Post subject: Reply with quote

helecho wrote:
GNU Bash runs in POSIX mode if the shebang is /bin/sh and specific features are explicitly specified in the documentation.

https://mywiki.wooledge.org/Bashism wrote:

"function" is not defined by POSIX

Code:
>cat test.sh
#!/bin/sh
function f { echo hello; }
f
>./test.sh
hello
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5433
Location: Removed by Neddy

PostPosted: Fri Mar 30, 2018 8:55 pm    Post subject: Reply with quote

Also:

Bash POSIX Mode

Starting Bash with the --posix command-line option or executing ‘set -o posix’ while Bash is running will cause Bash to conform more closely to the POSIX standard by changing the behavior to match that specified by POSIX in areas where the Bash default differs.
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10085
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Mar 30, 2018 9:06 pm    Post subject: Reply with quote

khayyam wrote:
It also doesn't help that you consistently use english as though it's Scrabble (meaning that you get a higher meaning/score based on the words used), this isn't the case, english relies very much on tight relations between words/statements, and expressivity (or vagueness) isn't a substitute for that.
Ah, but this is exactly the type of comment I would expect from an interlocutor! However, should we continue this disquisition, I'm afraid someone would accuse us of floccinaucinihilipilification. Hence, I would suggest that we both absquatulate from this topic.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6061
Location: Room 101

PostPosted: Fri Mar 30, 2018 10:03 pm    Post subject: Reply with quote

John R. Graham wrote:
Ah, but this is exactly the type of comment I would expect from an interlocutor! However, should we continue this disquisition, I'm afraid someone would accuse us of floccinaucinihilipilification. As such, I would suggest that we both absquatulate from this topic.

Typical antidisestablishmentarianism!!! ;)

best ... khay
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 17342

PostPosted: Fri Mar 30, 2018 11:04 pm    Post subject: Reply with quote

khayyam wrote:
It also doesn't help that you consistently use english as though it's Scrabble (meaning that you get a higher meaning/score based on the words used), this isn't the case, english relies very much on tight relations between words/statements, and expressivity (or vagueness) isn't a substitute for that.
Sometimes the verbiage people use is merely that with which they are familiar and comfortable.
_________________
The whole system has to go. The modern criminal justice system is incompatible with Neuroscience. --Sapolsky
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1344
Location: KUUSANKOSKI, Finland

PostPosted: Sat Mar 31, 2018 8:42 am    Post subject: Reply with quote

John R. Graham wrote:
What khayyam meant was that non-POSIX "bashisms" are accepted by bash even when it's in --posix mode. Therefore, if your goal is strict POSIX compatibility, testing under bash is problematic.
helecho wrote:
@John R. Graham: the POSIX mode does not exist to test conformance to the POSIX standard. It is the designers who do this work.
This mode allows a POSIX compliant script to be executed.


Therefore I declare: This discussion serves no purpose. End of story.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6061
Location: Room 101

PostPosted: Sat Mar 31, 2018 10:08 am    Post subject: Reply with quote

khayyam wrote:
It also doesn't help that you consistently use english as though it's Scrabble (meaning that you get a higher meaning/score based on the words used), this isn't the case, english relies very much on tight relations between words/statements, and expressivity (or vagueness) isn't a substitute for that.

pjp wrote:
Sometimes the verbiage people use is merely that with which they are familiar and comfortable.

pjp ... in some cases yes, but what I mean by "tight relations" is the "sense" of a statement, or argument, so for example, what does the following mean: "it seems to you equal that the interlocutor has a good faith"? Using a word like "interlocutor" doesn't cover the fact that the statement is unintelligible, and if you are going to try and sound intelligent you should at least make the additional effort to say something meaningful.

best ... khay
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 41298
Location: 56N 3W

PostPosted: Sat Mar 31, 2018 12:05 pm    Post subject: Reply with quote

This thread reminds me of the Postmans lines in this clip from Oh Mr Porter!
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6814

PostPosted: Sat Mar 31, 2018 1:09 pm    Post subject: Reply with quote

khayyam wrote:
what does the following mean: "it seems to you equal that the interlocutor has a good faith"?

Funny because i don't see where is the problem with this one.
it seems to you equal (to nothing, so you don't care) that the interlocutor (the speaker) has a good faith (was not saying lies ; that's the one i'm less sure, as a french i would had say "was of good faith")

Learn frenglish with krinn!
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6061
Location: Room 101

PostPosted: Sat Mar 31, 2018 7:12 pm    Post subject: Reply with quote

khayyam wrote:
what does the following mean: "it seems to you equal that the interlocutor has a good faith"?

krinn wrote:
Funny because i don't see where is the problem with this one. it seems to you equal (to nothing, so you don't care) that the interlocutor (the speaker) has a good faith (was not saying lies ; that's the one i'm less sure, as a french i would had say "was of good faith")

krinn ... that isn't surprising, as a non-native speaker you would be inclined to make associations that fill in the gaps of familiarity. I see no absolutely no relation between "equal" and "to nothing, so you don't care". Also, the context of "seemingness" is who-knows-where, the term should underscore the perception of the author (eg, "you seem to have it all wrong") and not the reader, which is made the subject of that seemingness ("you"). If I say "it seems to you" then it's unclear who's the subject of that seemingness, whereas if I say "it seems that you" I'm stating my perception of some state of affairs. I could go on ... but for brevity's sake I'll leave it at that.

krinn wrote:
Learn frenglish with krinn!

core blimey Monsieur!! ;)

best ... khay
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10085
Location: Somewhere over Atlanta, Georgia

PostPosted: Sat Mar 31, 2018 9:41 pm    Post subject: Reply with quote

Even so, I don't think helecho or any of the parties were acting in bad faith, nor do I think you all think so. I do think that helecho has a tendency to overestimate his level of comprehension of English (or perhaps the quality of machine translations) which leads him to take some...interesting positions.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum