Quantcast
Channel: sed in-place flag that works both on Mac (BSD) and Linux - Stack Overflow
Viewing all articles
Browse latest Browse all 16

sed in-place flag that works both on Mac (BSD) and Linux

$
0
0

Is there an invocation of sed todo in-place editing without backups that works both on Linux and Mac? While the BSD sed shipped with OS X seems to need sed -i ''…, the GNU sed Linux distributions usually come with interprets the quotes as empty input file name (instead of the backup extension), and needs sed -i … instead.

Is there any command line syntax which works with both flavors, so I can use the same script on both systems?


Viewing all articles
Browse latest Browse all 16

Trending Articles



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