Timeline for Bash here-documents and shebang lines
Current License: CC BY-SA 3.0
17 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 1, 2017 at 1:32 | comment | added | user149572 | I meant to edit this in the very start of the answer... Replacing the phrase "Yes, in this case" with a direct summary like "yes, this is the case but there might exceptions depending if you want to execute another script from a file, via the heredoc-script itself". | |
| Dec 31, 2016 at 20:57 | comment | added | Kusalananda♦ | @Benia done, I think. | |
| Dec 31, 2016 at 20:56 | history | edited | Kusalananda♦ | CC BY-SA 3.0 | added 410 characters in body |
| Dec 31, 2016 at 20:41 | comment | added | user149572 | @Kusalananda, I humbly recommend edit the answer in accordance with the clarification you gave me here about "in this case"... | |
| Dec 31, 2016 at 16:46 | comment | added | xhienne | I'm a proud nitpicker. Thanks and happy new year @Kusalananda | |
| Dec 31, 2016 at 16:45 | history | edited | Kusalananda♦ | CC BY-SA 3.0 | deleted 30 characters in body |
| Dec 31, 2016 at 16:44 | comment | added | Kusalananda♦ | @xhienne It's nitpicking, but I'll fix it. | |
| Dec 31, 2016 at 16:43 | comment | added | xhienne | @Kusalananda Thank you. There remain two superfluous "from the shell" in your answer. | |
| Dec 31, 2016 at 15:56 | history | edited | Kusalananda♦ | CC BY-SA 3.0 | added 1 character in body |
| Dec 31, 2016 at 15:55 | comment | added | Kusalananda♦ | @xhienne You're right. I'll fix it. | |
| Dec 31, 2016 at 15:46 | comment | added | xhienne | "The hash-bang line is used when executing an executable text file from the shell. The line tells the shell what interpreter to use to execute" => No, the shell does not analyze the file. The first line is read by the kernel when the script is executed as a stand-alone executable (i.e. ./my_script.sh vs /bin/shell my_script.sh), whatever executes it (not only the shell but any call to the execve() system call). | |
| Dec 31, 2016 at 12:57 | vote | accept | CommunityBot | moved from User.Id=149572 by developer User.Id=79749 | |
| Dec 31, 2016 at 12:47 | comment | added | Kusalananda♦ | I mean that in this case you're not running the script (in the here-doc) as an executable from the command line. You are in fact specifically saying "run this with bash". So, in this case, the shebang will just be a comment in the script. But, as I wrote, if the script in the here-doc was written to a file (cat >myscript.sh <<END_OF_SCRIPT), then the shebang would be needed, and the script would need to be made executable. It all comes down to how you plan to run the script in the here-doc. | |
| Dec 31, 2016 at 12:43 | comment | added | user149572 | Hi, you say "Yes, in this case". Can you clarify what particular case you mean to, or you mean globally ?... | |
| Dec 31, 2016 at 12:35 | history | edited | Kusalananda♦ | CC BY-SA 3.0 | added 41 characters in body |
| Dec 31, 2016 at 11:40 | history | edited | Kusalananda♦ | CC BY-SA 3.0 | added 350 characters in body |
| Dec 31, 2016 at 11:31 | history | answered | Kusalananda♦ | CC BY-SA 3.0 |