${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.

Examples

Convert a relative path into an absolute path with resolved links
1
2
3
cd /home/user/work
relativePath=./my-dir/sub/../my-file.txt
echo $relativePath:A
Output:
1
/home/user/work/my-dir/my_file_link_target.txt
BashSupport Pro 是一款支持 A** 的 **Zsh 集成开发环境 - 立即试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款