Quantcast
Viewing all articles
Browse latest Browse all 16

Answer by Zombo for sed in-place flag that works both on Mac (BSD) and Linux

The -i option is not part of POSIX Sed. A more portable method would beto use Vim in Ex mode:

ex -sc '%s/alfa/bravo/|x' file
  1. % select all lines

  2. s replace

  3. x save and close


Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>