frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Show HN: An A2A-compatible, open-source framework for multi-agent networks

https://github.com/openagents-org/openagents
5•snasan•25m ago•0 comments

Verifying your Matrix devices is becoming mandatory

https://element.io/blog/verifying-your-devices-is-becoming-mandatory-2/
110•LorenDB•5h ago•86 comments

A surprise with how '#!' handles its program argument in practice

https://utcc.utoronto.ca/~cks/space/blog/unix/ShebangRelativePathSurprise
37•SeenNotHeard•1d ago•32 comments

Loose wire leads to blackout, contact with Francis Scott Key bridge

https://www.ntsb.gov:443/news/press-releases/Pages/NR20251118.aspx
301•DamnInteresting•9h ago•118 comments

The lost cause of the Lisp machines

https://www.tfeb.org/fragments/2025/11/18/the-lost-cause-of-the-lisp-machines/
15•enbywithunix•10h ago•5 comments

Europe is scaling back GDPR and relaxing AI laws

https://www.theverge.com/news/823750/european-union-ai-act-gdpr-changes
629•ksec•15h ago•647 comments

Meta Segment Anything Model 3

https://ai.meta.com/sam3/
383•lukeinator42•13h ago•76 comments

What really happened with the CIA and The Paris Review?

https://www.theparisreview.org/blog/2025/11/11/what-really-happened-with-the-cia-and-the-paris-re...
43•frenzcan•1w ago•2 comments

Researchers discover security vulnerability in WhatsApp

https://www.univie.ac.at/en/news/detail/forscherinnen-entdecken-grosse-sicherheitsluecke-in-whatsapp
179•KingNoLimit•9h ago•60 comments

Building more with GPT-5.1-Codex-Max

https://openai.com/index/gpt-5-1-codex-max/
382•hansonw•12h ago•217 comments

Basalt Woven Textile – MaterialDistrict

https://materialdistrict.com/material/basalt-woven-textile/
4•rbanffy•37m ago•0 comments

Precise geolocation via Wi-Fi Positioning System

https://www.amoses.dev/blog/wifi-location/
144•nicosalm•8h ago•64 comments

AI is a front for consolidation of resources and power

https://www.chrbutler.com/what-ai-is-really-for
210•delaugust•11h ago•149 comments

What influence has the BBC had on history?

https://www.historytoday.com/archive/head-head/what-influence-has-bbc-had-history
18•pepys•2d ago•5 comments

Launch HN: Mosaic (YC W25) – Agentic Video Editing

https://mosaic.so
119•adishj•14h ago•108 comments

The Complete Work of Charles Darwin Online

https://darwin-online.org.uk/
30•bookofjoe•6d ago•2 comments

How Slide Rules Work

https://amenzwa.github.io/stem/ComputingHistory/HowSlideRulesWork/
89•ColinWright•9h ago•20 comments

CLI tool to check the Git status of multiple projects

https://github.com/uralys/check-projects
8•chrisdugne•5d ago•4 comments

Three Hapsburgs and a Reporter Walk into a Canadian Vault

https://www.nytimes.com/2025/11/16/insider/florentine-diamond-hapsburgs.html
16•samclemens•2d ago•6 comments

The Lucas-Lehmer Prime Number Test

https://www.scientificamerican.com/article/how-to-identify-a-prime-number-without-a-computer/
61•beardyw•1w ago•33 comments

Robert Louis Stevenson's Art of Living (and Dying)

https://lithub.com/robert-louis-stevensons-art-of-living-and-dying/
15•Caiero•10h ago•1 comments

Thunderbird adds native Microsoft Exchange email support

https://blog.thunderbird.net/2025/11/thunderbird-adds-native-microsoft-exchange-email-support/
377•babolivier•18h ago•111 comments

Static Web Hosting on the Intel N150: FreeBSD, SmartOS, NetBSD, OpenBSD and Linu

https://it-notes.dragas.net/2025/11/19/static-web-hosting-intel-n150-freebsd-smartos-netbsd-openb...
145•t-3•12h ago•49 comments

Gaming on Linux has never been more approachable

https://www.theverge.com/tech/823337/switching-linux-gaming-desktop-cachyos
322•throwaway270925•8h ago•228 comments

Vortex: An extensible, state of the art columnar file format

https://github.com/vortex-data/vortex
65•tanelpoder•5d ago•15 comments

The patent office is about to make bad patents untouchable

https://www.eff.org/deeplinks/2025/11/patent-office-about-make-bad-patents-untouchable
367•iamnothere•8h ago•38 comments

Measuring the impact of AI scams on the elderly

https://simonlermen.substack.com/p/can-ai-models-be-jailbroken-to-phish
78•DalasNoin•5h ago•27 comments

Racing karts on a Rust GPU kernel driver

https://www.collabora.com/news-and-blog/news-and-events/racing-karts-on-a-rust-gpu-kernel-driver....
59•mfilion•9h ago•3 comments

Measuring political bias in Claude

https://www.anthropic.com/news/political-even-handedness
58•gmays•10h ago•86 comments

Microsoft AI CEO pushes back against critics after recent Windows AI backlash

https://www.windowscentral.com/microsoft/windows-11/microsoft-ai-ceo-pushes-back-against-critics-...
156•thewebguyd•9h ago•168 comments
Open in hackernews

A surprise with how '#!' handles its program argument in practice

https://utcc.utoronto.ca/~cks/space/blog/unix/ShebangRelativePathSurprise
35•SeenNotHeard•1d ago

Comments

tombert•1h ago
Huh. I wish I had known this before.

NixOS is annoying because everything is weird and symlinked and so I find myself fairly frequently making the mistake of writing `#!/bin/bash`, only to be told it can't find it, and I have to replace the path with `/run/current-system/sw/bin/bash`.

Or at least I thought I did; apparently I can just have done `#!bash`. I just tested this, and it worked fine. You learn something new every day I guess.

miffe•1h ago
Seems like it only works in zsh, not bash or fish
tombert•1h ago

  [tombert@puter:~/testscript]$ ./myscript.sh
    bash: ./myscript.sh: bash: bad interpreter: No such file or directory
You are right. Appears to only work with zsh. I will resume being annoyed then.
adastra22•1h ago
Is this UNIX?
tombert•1h ago
This is NixOS, so no, it's Linux. I guess I just hoped it would work on Linux as well.
adastra22•1h ago
The kernel interprets the shebang line, not the shell.
jolmg•1h ago
It is possible for the shell to handle it. From zshall(1):

> If the program is a file beginning with ‘#!', the remainder of the first line specifies an interpreter for the program. The shell will execute the specified interpreter on operating systems that do not handle this executable format in the kernel.

Taking a quick look at the source in Src/exec.c:

  execve(pth, argv, newenvp);
  // [...]
  if ((eno = errno) == ENOEXEC || eno == ENOENT) {
              // [...]
              if (ct >= 2 && execvebuf[0] == '#' && execvebuf[1] == '!') {
                                // [...]
                                (pprog = pathprog(ptr2, NULL))) {
I guess at some point someone added that `|| eno == ENOENT` and the docs weren't updated.
tombert•1h ago
I'm not sure the reason then, but they're definitely right; it works fine with zsh, doesn't work with bash. I wrote a test script to try it myself.

I don't have fish installed and can't be bothered to go that far, but I suspect they're right about that as well.

anotherhue•1h ago
env bash is all well and good for normies, but if you're already on NixOS did you know you can have nix-shell be your interpreter and back flip into any reproducible interpreted environment you like?

https://nixos.wiki/wiki/Nix-shell_shebang

Crestwave•1h ago
`#!/usr/bin/env bash` is the most portable form for executing it from $PATH
hamandcheese•1h ago
Is this meaningfully more portable than #!bash though?
tombert•1h ago
In a sibling thread someone pointed out that #!bash doesn't actually work if you're calling it from bash, and appears to only work with zsh.

I just tried it and they were absolutely right, so `#!/usr/bin/env bash` is definitely more portable in that it consistently works.

saurik•1h ago
This mechanism doesn't do a PATH lookup: #!bash would only work if bash was located in your current working directory.
nflekkhnnn•1h ago
Anything other than ”#!/usr/bin/env bash” is doomed to fail at some time.
normie3000•47m ago
And is this shebang guaranteed to work always? Why isn't it more common?
eyelidlessness•43m ago
It’s quite common, although I probably see it used more frequently to invoke other (non-shell) scripting languages.
int_19h•41m ago
It's guaranteed to work provided that Bash is in the path.

It's very common for Python. Less so for Bash for two reasons: because the person who writes the script references /bin/sh instead (which is required to be there) even when they are writing bash-isms, or because the person who writes the script assumes that Bash is universally available as /bin/bash.

jolmg•41m ago
Because /bin is the standard location for bash. The only one that breaks that expectation is NixOS (and maybe GuixSD?), apparently. I'm surprised they didn't symlink /bin or put a stub. Last time I tried NixOS was like 10 years ago. I thought there was a /bin/bash, but maybe it was just a /bin/sh?

Other interpreters like python, ruby, etc. have more likelyhood of being used with "virtual environments", so it's more common to use /usr/bin/env with them.

tombert•32m ago
They do symlink /bin/sh to be fair, and that's very often good enough for a lot of scripts. That's what I usually do if I don't need anything bash offers.
rmunn•18m ago
Thing is, a few years ago when Debian changed its default sh from bash to ... either ash or dash, I forget which, I got into the habit of always writing `#!/bin/bash` at the top of my scripts, in case I didn't realize that something I was using was a bashism not found in classic /bin/sh. So if I used Nix (I don't, since for my particular use cases the juice isn't worth the squeeze), I would get seriously messed up by that.
saintfire•1h ago
You can use `#!/usr/bin/env bash` on NixOS
tombert•1h ago
I didn't know that actually. I'll start using that from this point forward.
teo_zero•9m ago
> apparently I can just have done `#!bash`

I think you're mixing two concepts: relative paths (which are allowed after #! but not very useful at all) and file lookup through $PATH (which is not done by the kernel, maybe it's some shell trickery).

jolmg•1h ago
> Although this is probably the easiest way to implement '#!' inside the kernel, I'm a little bit surprised that it survived in Linux (in a completely independent implementation) and in OpenBSD (where the security people might have had a double-take at some point). But given Hyrum's Law there are probably people out there who are depending on this behavior so we're now stuck with it.

I don't see what there would be to gain in disallowing the program path on the shebang line to be relative. The person that wrote the shebang can also write relative paths in some other part of the file.

saurik•1h ago
Or, like, if you aren't reading and caring about what the interpreter is--as that's the only time this can burn you: it isn't doing a PATH lookup, so you can't walk into this one on accident--then it could literally be something like /bin/rm on some key file. This entire article is based on an assumption that this is somehow so obviously bad that there doesn't even need to be an explanation or defense of any kind of that idea.
jolmg•23m ago
> This entire article is based on an assumption that this is somehow so obviously bad that there doesn't even need to be an explanation or defense of any kind of that idea.

I'm not reading it like that. The tone is just one of surprise, since this isn't something that one typically sees. Since it's obscure, it leads one to wonder if it can be bad, and I don't see how it could be.

I think it survived in the independent Linux because it's the simple and obvious way to do things, and it doesn't lead to any exceptional power of misuse one didn't already have with writing the rest of the file.

jibal•32m ago
There's no security issue here. Certainly the OP hasn't explained why there is one.
somat•17m ago
The thing that surprised me was that you can't write an interpreter in an interpreted language, at least not in obsd. It is possible if you jump through a few hoops but you can't directly call it.

An example: if you made a language in python /bin/my_lang: #does nothing but pretend it does

    #!/usr/local/bin/python3
    import sys
    print('my_lang args', sys.argv)
    for line in sys.stdin:
      print('invalid_line:', line)
my_script:

    #!/bin/my_lang
    line of stuff
    another line of stuff
chmod u+x my_script ./my_script

Probably for the best, but I was a bit sad that my recursive interpreter scheme was not going to work.

jolmg•8m ago
Worked for me, but the way you described it has issues:

1. You chmod my_script twice.

2. Did you chmod u+x /bin/my_lang too? Since you put it in /bin, are you sure the owner isn't root?, in which case your user wouldn't have execute permission. Try +x instead of u+x.

3. Do you have python in that path? Try `/usr/bin/env python` instead.

4. In case you expected otherwise, my_script wouldn't be passed through stdin. It's just provided as an argument to my_lang.

rmunn•8m ago
Hit the link expecting to read about UTF-8 Byte Order Marks at the top of the file, so that the first few bytes aren't actually #! but 0xEF 0xBB 0xBF #! instead. Ran into this one just a few months ago when a coworker who uses Windows had checked a Bash script into the Git repo. His editor was configured to save files as "UTF-8 with BOM" and so we were getting errors that looked like "./doit.sh: line 1: #!/bin/bash: No such file or directory". Can you see the invisible BOMb in that line? It's there, I promise you.

That's not what the article was actually about, as it turned out. The surprise in the article was about relative paths for script shebang lines. Which was useful to learn about, of course, but I was actually surprised by the surprise.