shelljs / shx

Portable Shell Commands for Node
MIT License
1.72k stars 44 forks source link

docs(sed): document sed syntax, quoting, and escaping slash #170

Closed nfischer closed 4 years ago

nfischer commented 4 years ago

No change to logic, only docs.

This documents the special sed syntax (ex. shx sed s/foo/bar/g filename.txt). With that, this mentions that / is a special character, so the user must escape that if it's present in either the regex or replacement string.

This also documents how Windows handles single quotes differently, so it's desirable to avoid single quotes in package.json scripts. This part isn't specific to sed, but since it's popular to quote sed expressions, I'm adding this to the docs at the same time.

Fixes #165 Fixes #169

codecov-io commented 4 years ago

Codecov Report

Merging #170 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #170   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines         114    114           
=====================================
  Hits          114    114

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e5c1513...bbcc217. Read the comment docs.