Have a look if this may help:
telord@antiX1:~/Temp
$ cat tester.sh
- Code:
#!/usr/bin/env bash
echo ${1:5}
exit 0
reslut:
- Code:
$ bash tester.sh 12345foo
foo
The 1 is from $1, the :5 means from char number 5. :5:7 would be from 5-7... :0:3 would be the first three...
in case that was not clear (i gues it was clear, but ${1} is a bit confusing to me, and adding the colon doesn't make it better.
If the variable wouldn't be $1 but, say, $answer, it is more clear, i think:
echo ${answer:5}
or:
echo ${answer:0:3}
btw and PS: I had to look it up in my example code myself. I don't know such things out of box. (I use it when asking a user if the script shall go on and i only care if he/she gives y or not y (be it y, yes, yaba-duh or whatever).)