fork download
  1. #!/bin/bash
  2. s='[profile gateway]
  3. [profile personal]
  4. [profile DA]
  5. [profile CX]'
  6. sed -n 's/.*\[profile *\([^][]*\).*/\1/p' <<< "$s"
Success #stdin #stdout 0.01s 5632KB
stdin
Standard input is empty
stdout
gateway
personal
DA
CX