Unverified50% confidenceFactExact time
$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.
1
Sources
50%
Confidence
Long-term
Relevance
10/12/2026
First Seen
Sources
Related Entities
Related Claims
UnverifiedEnvironment 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.68% similarUnverifiedThe parameter expansion syntax ${path##*/} built into Bash and Zsh can achieve the same effect as basename and eliminates subprocess overhead in loop scenarios.67% similarUnverifiedThe contents of the PATH environment variable, when read by a system call (such as execvp), do not go through the shell's expansion process, so a ~ in PATH is treated as an ordinary character-based directory.66% similarUnverifiedWhen using basename in a batch processing loop, variables must be wrapped in double quotes if the path or filename contains spaces; otherwise, the shell will misinterpret spaces as argument separators, causing the script to fail.61% similarUnverifiedIn 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.59% similar
Cite This Claim
Stable URI
https://kongchang.com/claim/1012614API
curl https://kongchang.com/api/v1/knowledge/claims/1012614MCP
get_claim(id=1012614)