Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Best practices for managing aliases in ohmyzsh?



On 2021-09-01 1:03 p.m., Bart Schaefer wrote:

No.  "#!" is a comment, because it begins with "#".

I've always wondered about the syntax of that.  Seemed to me it was the one exception.  But ... what you're saying is that the shells themselves ignore the shebang as just another comment, but when you 'execute' the file, a closer look it taken, yes?  So, if I source a file, the shebang is 'just another comment' but if I execute it, the shebang is paid attention to because there is no presumption as to the correct interpreter -- could be Python, could be anything.

... superficial
similarities so that incorrect interpreters can recognize themselves
and do a backflip, but for the most part it is indeed "barf."
Sounds like a whole lot more trouble than it could be worth.  For now what I'm coming away with is that the shebang is only relevant if I have a 'chmod +x' file and execute it as tho it were a binary. And sourcing is not the same thing as 'executing'.   I've not done any of this executing of anything zsh yet, so up till now the issue has not come up, but I'm now forewarned, many thanks.




Messages sorted by: Reverse Date, Date, Thread, Author