${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 是一款支持 A** 的 **Zsh 集成开发环境 - 立即试用!