[kwlug-disc] Why I Don't Use #!/bin/bash - Shebangs Explained! (Another one by Dave at YSAP)
Ron
ron at bclug.ca
Sun Aug 31 01:55:03 EDT 2025
It's a long weekend, a good time to play in the garden, ride bicycles up
and down hills, and watch some `bash` videos.
Dave at YSAP discusses "shebang" lines and does his deep-dive into them.
Shebang lines are those lines at the top of a script that bash
processes, right?
Wrong. Bash ignores that line, it's the kernel that processes the shebang.
Node / v8 also are smart enough to ignore the shebang line, even though
lines starting with # in JS are *not* comments. Cool!
He compares behaviours on Darwin, Void Linux, and IllumOS / SunOS.
Differences show up when passing options in shebang lines.
Lots of interesting tricks can be had by tweaking that line, and after
some 10 minutes of general explanation, he heads down the rabbit hole
starting with his favourite distro, Void Linux.
> https://www.youtube.com/watch?v=aoHMiCzqCNw
TL;DR:
use:
#!/usr/bin/env bash
(or, since I'm a new convert)
#!/usr/bin/env fish
More information about the kwlug-disc
mailing list