fork(1) download
  1. #!/bin/bash
  2. s='bob mary mike bill kim jim john'
  3. perl -lane 'while (/(?=\b(\p{L}+\s+\p{L}+))/g) {print $1}' <<< "$s"
Success #stdin #stdout 0.01s 5540KB
stdin
Standard input is empty
stdout
bob mary
mary mike
mike bill
bill kim
kim jim
jim john