1 2 3 4 5 6 7 8 9 10 11 12 13 14
# these didn't work in versions of bash before bash-4.0 LNAME=nordholz echo ${LNAME[$(( 0 ))]//h/!} echo ${LNAME[$(( 2 ))]//h/!} echo ${LNAME[$(( 0 ))]##??} echo ${LNAME[$(( 2 ))]##??} echo ${LNAME[$(( 0 ))]:2} echo ${LNAME[$(( 0 ))]:2:4} echo ${LNAME[$(( 2 ))]:2} echo ${LNAME[$(( 2 ))]:2:4}