${name:e}
: File Extension
Extracts the file extension from a path.
It takes the last segment of the path and returns the string after the last .
of this filename segment.
If there is no .
character or if the filename ends with .
, then an empty string is returned.
Links
Examples
- Extract file extension of a path
- Output:
1 2
myPath="/home/user/work/data.csv" echo $myPath:e
1
csv
BashSupport Pro ist eine Zsh IDE mit Unterstützung für $varName:e - probieren Sie es jetzt aus!