I'm trying to do a substring on bash and I'm following this Bash scripting cheat sheet.
echo $(pwd)
> Successfully outputs the current working DIR
What am I doing wrong?
I'm trying to slice the $(pwd)
at the index 2. I know it's possible to omit the length, to return the rest of the string from that position.
So I'm doing this, and I'm getting the bad substitution
error.
echo ${$(pwd):2}
> bash: ${$(pwd):2}: bad substitution