Skip to main content
2 of 2
added 12 characters in body
Stéphane Chazelas
  • 584.7k
  • 96
  • 1.1k
  • 1.7k

The best way I have found to have the same script work on both Linux and Mac is to:

sed -i.bak -e 's/foo/bar/' -- "${TARGET}" &&
  rm -- "${TARGET}.bak"
vikrantt
  • 221
  • 2
  • 2