fork download
  1. #!/bin/bash
  2. echo "xx yy [a1 b1] / zz [a2 b2]/" | awk '{p=gensub(/[^][]*\[([a-z0-9 ]+)\].*/,"\\1",1); print $2,p}'
Success #stdin #stdout 0s 4192KB
stdin
Standard input is empty
stdout
yy a1 b1