fork(5) download
  1. #!/bin/bash
  2. #s="32432423 jkhkjh [234] hkjh32 2342342"
  3. s="[GLOBAL] and [MAIL_1]"
  4. grep -o '\[[^][]*]' <<< "$s"
Success #stdin #stdout 0s 4364KB
stdin
Standard input is empty
stdout
[GLOBAL]
[MAIL_1]