https://www.in-ulm.de/%7Emascheck/various/shebang/ #shebang #tech #humor #coding #HackerNews #ngated
#!magic, details about the shebang/hash-bang mechanism on various Unix flavours
https://www.in-ulm.de/%7Emascheck/various/shebang/
#HackerNews #shebang #Unix #magic #hashbang #Linux #programming
A surprise with how '#!' handles its program argument in practice
https://utcc.utoronto.ca/~cks/space/blog/unix/ShebangRelativePathSurprise
#HackerNews #Shebang #Surprise #ProgramArguments #Unix #HackersNews
It's kind of amazing the difference it makes in final #container size when you select the FROM image in your #Dockerfile.
$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/doc-preview latest 360b4d419e79 10 seconds ago 436 MB
localhost/doc-review/python3.12-alpine latest e05851293725 12 minutes ago 209 MB
localhost/doc-review/python-latest latest 5077ac676c94 18 minutes ago 1.28 GB/bin/sh since /bin/bash wasn't available (it was a very simple script with no #BASHisms, so changing the script's #SheBang wasn't an issue).I always had some here and there issues with shebang in my scripts and I always tried to stick to some rules sometimes without knowing why. I just stumbled upon this nice video that showcases some of the edge cases:
I've been following #YouSuckAtProgramming for a while: https://youtu.be/aoHMiCzqCNw - and I really enjoy the content.
Dave is mainly focusing on
#bash, often digging deep about the topic or command. This one about #shebang is one of those.
Now I know much better 🤪
@TheConstructor @khalidabuhakmeh and here is what #roslyn is doing with our file based program https://github.com/dotnet/roslyn/blob/main/docs%2Ffeatures%2Ffile-based-programs-vscode.md
```
produce a C# project XML document in memory, and pass it off to MSBuild. The in-memory project is sometimes called a "virtual project".
```
The #shebang file based program is neat
Demystifying the (Shebang): Kernel Adventures
https://crocidb.com/post/kernel-adventures/demystifying-the-shebang/
#HackerNews #Demystifying #the #Shebang #Kernel #Adventures #Shebang #Linux #Programming
You probably know you can package #python files into a zip file and python will execute it like a script. But did you know that you can put a #shebang line in it?
If `foo.zip` contains `__main__.py` you can do
`echo '#!/usr/bin/python | cat - foo.zip > foo`
and
`chmod u+x foo`
then you can run `foo` like an ordinary program and it will run the contents of `__main__.py`
although I have no idea if you *should* do this.