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

Examples

Convert a relative path into an absolute path
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.txt
BashSupport Pro ist eine Zsh IDE mit Unterstützung für $varName:a - probieren Sie es jetzt aus!
© 2020–2024 Joachim Ansorg
Impressum
Datenschutz
Rechtliches