substring a date

view story

http://www.unix.com – Hello I am trying to substring the month in a date string I am getting an error " bad substitution" Code: #!/bin/ksh INPUT='20121225' echo ${$INPUT:5:2} exit 0 Very new in unix. Thanks. Moderator's Comments: Please use code tags next time for your code and data. (HowTos)