Bash last char of a string
Posted: Sun Sep 02, 2018 7:11 pm
Hi,
does anyone know how to get the last characters of a string?
in bash.
Thanks
does anyone know how to get the last characters of a string?
in bash.
Thanks
Forum of Webmaster2020.com
https://www.webmaster2020.com/forum/
Code: Select all
echo "${FILENAME:$((${#str}-1)):1}"
Code: Select all
echo ${STRING: -1}