${name:r}: Remove file extension

Removes the file extension from a file path. This is the opposite of :e, which evaluates to the file extension.

Examples

Print path without file extension
1
2
path="/dir/subdir/file.csv"
echo $path:r
Output:
1
/dir/subdir/file
BashSupport Pro is a Zsh IDE with support for $varName:rtry it now!
© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal