$>expr substr 'abcdefg' 1 3 abc
zzh@ZZHPC:~$ a=123456789 zzh@ZZHPC:~$ echo ${a:2} 3456789 zzh@ZZHPC:~$ echo ${a:3:3} 456 zzh@ZZHPC:~$ echo ${a:3:${#a}} 456789 zzh@ZZHPC:~$ echo ${a:(-3)} 789 zzh@ZZHPC:~$ echo ${a:0:-3} 123456 zzh@ZZHPC:~$ echo ${a:1:-3} 23456