til
til copied to clipboard
Shell Parameter Expansion
eg: How to extract filename and extension
> FILE="example.tar.gz"
> echo "${FILE%%.*}"
example
> echo "${FILE#*.}"
tar.gz
> echo "${FILE##*.}"
gz
https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html