Tuesday, September 17, 2013

Bash: substring of a constant string

Bash: substring of a constant string

I know, that there is a way to get substring of a string variable:
MY_STR=abacaba
echo ${MY_STR:2:6}
Is there a way to get substring of a string given as literal constant?
Something like:
echo ${"abacaba":2:6}

No comments:

Post a Comment