I\'m pretty new at bash so this is a pretty noob question..
Suppose I have a string:
string1 [string2] string3 string4
I would like
In pure bash:
STR="string1 [string2] string3 string4" STR=${STR#*[} STR=${STR%]*} echo $STR