Follow-up Comment #1, sr #106057 (project grep):

$ echo aa [ bb ] cc ] dd | grep -o "[ [^]]* ]"
[ bb ]

If you need to remove the square brackets:

$ echo aa [ bb ] cc ] dd | grep -o "[ [^]]* ]" | sed 's/[][]//g'
 bb 

where '[][]' means a character class containing ']' and '['.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/support/?106057>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



Reply via email to