Details about the shebang/hash-bang mechanism on various Unix flavours (2001)
Mood
thoughtful
Sentiment
positive
Category
tech
Key topics
Unix
Shebang
Scripting
Detailed information about the shebang/hash-bang mechanism on various Unix flavours.
Snapshot generated from the HN discussion
Discussion Activity
Active discussionFirst comment
3h
Peak period
14
Day 1
Avg / period
14
Based on 14 loaded comments
Key moments
- 01Story posted
Nov 20, 2025 at 12:07 AM EST
4d ago
Step 01 - 02First comment
Nov 20, 2025 at 3:16 AM EST
3h after posting
Step 02 - 03Peak activity
14 comments in Day 1
Hottest window of the conversation
Step 03 - 04Latest activity
Nov 20, 2025 at 11:18 AM EST
3d ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Do you see the invisible BOMb in the error message? Neither did I the first time. (And, in fact, Ghostty apparently stripped it out when I copied and pasted, so it's not actually there in this comment). But if I were to load that doit.sh script I created for this example into VS Code, I'd see the telltale "UTF-8 with BOM" file format.
Most people already know this, but maybe this will help someone out there. If you see a "No such file or directory" error and the program being executed apparently starts with #!, it probably actually starts with U+FFEF#! and you need to re-save the script in UTF-8 without a BOM(b) at the start.
Irritatingly, you'll find BOMs to not be uncommon in CSV files because of Excel, which interprets files as CP1252 (a superset of the printable characters of ISO 8859-1, sometimes known as Win1252 or Windows-1252) if the BOM is not present, causing anything beyond ASCII to be misinterpreted (accented characters are usually the first thing people in Europe notice getting garbled, currently symbols other than $ too).
Not my editor of choice but some swear by it and are prone to work cross platform across NAS's and SSH terminals with either windows or some *nix as 'primary' work space.
I'm sure other editors have this as an option, the time I ran into BOM issues I traced it back to the use of Notepad++ by a third party.
When you involve Windows, which likes a random mix of UTF-16, UCS-2, CP1252, and I guess also UTF-8 with BOM, you're screwed.
See also https://www.felesatra.moe/blog/2021/07/03/portable-bash-sheb...
2 more comments available on Hacker News
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.