A string is returned by myString=$(some_command)
.
The resulting value of myString
looks like:
there are spaces in this line.
What specific bash
command can be typed to extract only the last n
number of characters after the final space in the resulting value of myString
?
For the example value of myString
shown above, I would want to extract the 5 characters line.
However, for a different value of myString
like "this line has many spaces.", the desired sliced output would be spaces.