#!/bin/bashs='bob mary mike bill kim jim john'perl -lane 'while (/(?=\b(\p{L}+\s+\p{L}+))/g) {print $1}' <<< "$s"
Standard input is empty
bob mary mary mike mike bill bill kim kim jim jim john
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!