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

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

$
0
0

There is no way to have it working.

One way is to use a temporary file like:

TMP_FILE=`mktemp /tmp/config.XXXXXXXXXX`sed -e "s/abc/def/" some/file > $TMP_FILEmv $TMP_FILE some/file

This works on both


Viewing all articles
Browse latest Browse all 16

Trending Articles



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