Guest User

Untitled

a guest
Oct 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. cat << EOF | sed -e "s/^[^:]*/x1b[31m&x1b[0m/g" | sed -e "s/to/x1b[31m&x1b[0m/g"
  2. foo: 1 to 2
  3. bar: 3 to 4
  4. quux: 5 to 6
  5. EOF
  6.  
  7. s/regexp/replacement/
  8. Attempt to match regexp against the pattern space. If success‐
  9. ful, replace that portion matched with replacement. The
  10. replacement may contain the special character & to refer to that
  11. portion of the pattern space which matched, and the special
  12. escapes 1 through 9 to refer to the corresponding matching
  13. sub-expressions in the regexp.
Add Comment
Please, Sign In to add comment