${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 3cd /home/user/work relativePath=./my-dir/sub/../my-file.txt echo $relativePath:A1/home/user/work/my-dir/my_file_link_target.txt
BashSupport Pro is a Zsh IDE with support for $varName:A – try it now!