fork download
  1. #!/bin/bash
  2. text="manoeuvre man man trackman"
  3. replace="man"
  4. perl -spe 's/\s*(?!\B\w)\Q${replace}\E(?<!\w\B)//g' -- -replace="$replace" <<< "$text"
Success #stdin #stdout 0.01s 5540KB
stdin
Standard input is empty
stdout
manoeuvre trackman