Unverified50% confidenceFactExact time
In an interactive shell, the expansion of ~ (tilde expansion) is performed by the shell at the lexical level when parsing the command line, occurring before the command is actually executed, and its object is the command-line text rather than the value of an environment variable.
1
Sources
50%
Confidence
Long-term
Relevance
10/12/2026
First Seen
Sources
Related Entities
Related Claims
UnverifiedInvocation paths that do not go through the shell (such as directly using execvp, posix_spawn, or the process-launching functions implemented in many languages' standard libraries) do not trigger tilde expansion, because they do not parse shell syntax.68% similarUnverifiedShell glob expansion is completed before command execution, so programs like sed see the expanded real paths rather than the original strings containing wildcards.64% similarUnverifiedEnvironment variable assignments (such as $env:FOO=bar or export FOO=bar) are only effective in the current Shell process and its child processes, and become invalid when the terminal is closed; to take effect permanently, they need to be written into the Shell startup script (such as .bashrc, .zshrc, $PROFILE) or system environment variables.61% similarUnverified$HOME is a real environment variable, and referencing it constitutes parameter expansion, which the shell completes before executing the command, with the replacement result being the absolute path string of the home directory.59% similar
Cite This Claim
Stable URI
https://kongchang.com/claim/1012610API
curl https://kongchang.com/api/v1/knowledge/claims/1012610MCP
get_claim(id=1012610)