shelljs / shx

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

sed should be silent if '-i' is provided #159

Open nfischer opened 5 years ago

nfischer commented 5 years ago
$ sed -i 's/foo/bar/g' file.txt # note: this is silent
$ cat file.txt
bar
$ shx sed -i 's/bar/baz/g' file.txt # this should be silent
baz
$ shx cat file.txt
baz

We could arguably make the change in shelljs itself (which would help n_shell).

nfischer commented 2 years ago

This will be fixed in the next shelljs release. This is a breaking change in shelljs, so it might take a bit to get it released.

Keeping this open since we'll need to pull in a new shelljs version to get this fixed in shx.

wondering639 commented 4 months ago

any ETA on when this will be fixed? Workaround: shx sed -i "s/original/replaced/g" myfile.txt > hidden.txt && shx rm -f hidden.txt