TL;DR
Get business pricing on monitors, keyboards and dev gear
- Business-only prices and quantity discounts
- Tax-exempt purchasing
- Multiple users, one account, clear invoices
A report published by developer Disconnect3d explains that writing `export PATH=”$PATH:~/.local/bin/”` can leave the tilde unexpanded, so the shell searches a relative `~/.local/bin` directory instead of the user’s home directory. The recommended fix is to use `$HOME`, and a grep command can help find PATH entries containing a literal tilde.
Developer Disconnect3d reported that a common-looking shell configuration, `export PATH=”$PATH:~/.local/bin/”`, can add a literal `~/.local/bin/` entry to PATH instead of the directory under a user’s home folder. The distinction matters because commands may be found in an unintended relative directory; the report recommends using `$HOME` in the quoted assignment and checking PATH for entries containing a tilde.
In a post published on October 2, Disconnect3d said the issue came to light while testing nono, a tool for sandboxing agents. The tool warned that the sandbox could write to a PATH entry displayed as `~/.local/bin/`. The developer said this looked suspicious because the entry might not represent the user’s home directory.
The report explains that in Bash, tilde expansion generally applies when a word begins with an unquoted tilde. Quoting the full assignment in `export PATH=”$PATH:~/.local/bin/”` prevents the tilde from expanding in that position. The recommended form is `export PATH=”$PATH:$HOME/.local/bin/”`, which explicitly supplies the home-directory path through the `HOME` environment variable.
Disconnect3d also showed a command resolving an executable from a directory literally named `./~/.local/bin/`, created relative to the current working directory. In that demonstration, a program named `kek` ran from that relative directory; the home directory was not involved. The post suggests checking with `echo “$PATH” | tr ‘:’ ‘\n’ | grep ‘~’`. A match flags an entry containing a tilde, though the post does not establish how widespread the configuration is.
When PATH Points Somewhere Else
PATH tells a shell where to look when a user runs a command without specifying its full location. If an entry is interpreted as a relative path rather than a home-directory path, command lookup may depend on the current working directory. That can make a configuration behave differently from what its author intended.
The report’s practical warning is not that every tilde in PATH creates an immediate security incident. Rather, a mistaken entry can make it harder to know which executable a shell will find. This is especially relevant when tools inspect writable PATH locations, as nono did in the report: a path that looks like a personal bin directory may not resolve to the user’s home at all.
Using `$HOME` makes the intended location explicit in the quoted assignment. Checking existing PATH entries can help users identify possible mistakes, but finding a tilde alone does not reveal the full effect in every shell or configuration; users should inspect the relevant startup file and the actual directory being searched.
Products Worth Considering

Blueair Blue Pure 211i Max Air Purifier for Large Rooms

Garmin Venu Sq 2 GPS Smartwatch, Slate and Shadow Gray

Oura Ring 5 Smart Ring – Stealth, Size 11
As an affiliate, we earn on qualifying purchases.
How Shell Expansion Applies
The issue concerns the difference between shell syntax and literal text. A tilde at the start of an eligible, unquoted word can be replaced with a home-directory path. Quoting changes how the shell interprets characters, so a tilde inside a quoted portion of a PATH assignment may remain literal instead of being expanded.
Disconnect3d notes an important qualification: an unquoted assignment such as `export PATH=$PATH:~/.local/bin` works in Bash and Zsh, because those shells perform tilde expansion in certain assignment positions, including after a colon. The post calls that approach fragile, saying whitespace can break the assignment. Its suggested quoted form using `$HOME` avoids relying on the special tilde-expansion behavior described in the report.
The report cites Bash documentation on tilde prefixes in words and variable assignments. It also presents a small local demonstration: creating `./~/.local/bin`, placing a compiled program there, then running it with a PATH set to `~/.local/bin/`. In that example, the shell finds the program under the literal directory named `~`.
““PATH entries the sandbox can write to: ~/.local/bin/””
— Disconnect3d, in the October 2 blog report
Scope and Shell Differences
The report provides a shell-behavior explanation and a local demonstration, but it does not measure how many users or systems have affected startup-file entries. It also does not report a security incident or show that the configuration has caused harm beyond the demonstrated command lookup.
The examples focus on Bash and Zsh. The post does not document how every shell, operating system, or PATH-processing tool handles the same text. A grep match identifies a tilde-containing PATH entry, but users still need to inspect the entry and their shell configuration to determine whether it is actually incorrect.
Check and Correct Startup Files
Users who want to check their current PATH can run `echo “$PATH” | tr ‘:’ ‘\n’ | grep ‘~’` to print entries containing a tilde. If an entry appears, the report advises reviewing files such as `.bashrc`, `.zshrc`, and `.profile` and replacing the quoted `~` with `$HOME` where the intention is to refer to the home directory.
Disconnect3d said they planned to submit a pull request to make nono’s warning more verbose. The post does not give a timeline for that change. Until then, the reported check and explicit `$HOME` form are the practical steps offered; the article provides no broader follow-up data on how often the issue occurs.
Key Questions
What is the PATH tilde problem?
In a quoted assignment such as `export PATH=”$PATH:~/.local/bin/”`, the tilde may remain literal. The shell can then search for a relative directory named `~/.local/bin` rather than the `.local/bin` directory inside the user’s home folder.
What should I use instead?
For the quoted assignment described in the report, use `export PATH=”$PATH:$HOME/.local/bin/”`. `$HOME` explicitly provides the home-directory path.
How can I check whether PATH contains a tilde?
Run `echo “$PATH” | tr ‘:’ ‘\n’ | grep ‘~’` to show PATH entries containing a tilde. A result is a prompt to inspect the entry and the startup-file setting that added it.
Does every tilde in PATH mean something is wrong?
No. The report identifies a specific risk involving a quoted assignment and explains that unquoted tilde expansion can work in Bash and Zsh in certain assignment positions. A match from the check alone does not establish how an entry is being interpreted.
Source: hn
