${name:A}
: Absolute Path with resolved links
Interprets the variable value as a file path, turns it into an absolute path and resolves symbolic links.
Use modifier :a
if you would not like to resolve symbolic links.
Use modifier :P
to use realpath
semantics.
Links
Examples
- Convert a relative path into an absolute path with resolved links
- 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_link_target.txt
BashSupport Pro ist eine Zsh IDE mit Unterstützung für $varName:A - probieren Sie es jetzt aus!