deppfx@localhost:/tmp$ echo ${$(hostname): -3}
-bash: ${$(hostname): -3}: bad substitution
I am looking for the output as ost
.
It should be ${variable: -3}
. Don't try to substitute command.
The substitution works in variables, not in commands.
echo $(myVar=$(hostname);echo ${myVar: -3})