Bash: Print last two characters from string 28. November 201128. November 2011 prego Ein Kommentar user@desktop:~$ VAR=foobar user@desktop:~$ echo $VAR foobar user@desktop:~$ echo ${VAR: -2} aruser@desktop:~$ VAR=foobar user@desktop:~$ echo $VAR foobar user@desktop:~$ echo ${VAR: -2} ar Siehe auch: Bash: Delete last character from string Bash: Delete first character from string