fork(8) download
  1. #!/bin/bash
  2. s='Grocery store bank and hardware store
  3. Apples Bananas Milk'
  4. sed 's/Apples/& Check/g' <<< "$s"
  5. sed 's/\<Apples\>/& Check/g' <<< "$s"
  6. sed -E 's/\<Apples(\s+Check)?\>/& Check/g' <<< "$s"
Success #stdin #stdout 0.01s 5688KB
stdin
Standard input is empty
stdout
Grocery store bank and hardware store
Apples Check Bananas Milk
Grocery store bank and hardware store
Apples Check Bananas Milk
Grocery store bank and hardware store
Apples Check Bananas Milk