A contrived example... given
FOO=\"/foo/bar/baz\"
this works (in bash)
BAR=$(basename $FOO) # result is BAR=\"baz\" BAZ=${BAR
${string:0:1},string must be a variable name
for example:
FOO="/foo/bar/baz"
baz="foo"
BAZ=eval echo '${'"$(basename $FOO)"':0:1}'
eval echo '${'"$(basename $FOO)"':0:1}'
echo $BAZ
the result is 'f'