Solution:s='1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4' p='1 2 3 4' echo "$s"|sed "s/$p\s*/&\n/g" 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)