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}
You can use cut:
$ echo abacaba | cut -c3-7
acaba
Saying -c3-7 would get characters 3 to 7 (note that the first character is denoted by 1).
For getting all the characters starting from the 3rd one, you could say:
$ echo abacaba | cut -c3-
acaba
You can also use tail:
$ echo abacaba | tail -c+3
acaba
find . -exec bash -c "echo \"{}\" | cut -c3-" \;for example.