${name:a}
: Absolute Path
Interprets the variable value as a file path and turns it into an absolute path.
This modifier does not resolve symbolic links.
Use modifier :A
to resolve symbolic links.
Use modifier :P
to use realpath
semantics.
Links
Examples
- Convert a relative path into an absolute path
- Output:
1 2 3
cd /home/user/work relativePath=./my-dir/sub/../my-file.txt echo $relativePath:a
1
/home/user/work/my-dir/my-file.txt
BashSupport Pro ist eine Zsh IDE mit Unterstützung für $varName:a - probieren Sie es jetzt aus!