On Linux Mint, using bash..
test="-ffoo"; echo ${test:0:2}
works outputting the first two characters
but
test="-efoo"; echo ${test:0:2}
fails, with apparently null output.
I'm thinking the form of this is
${parameter:offset:length}
I know enough that parameter characters cannot be *@#?-$!0_
but $test
is the parameter - surely its contents can be anything? I guess -e
is triggering something shell-like but why..