I have a Bash script which replaces a PHP constant, e.g. define('xxxx',....); with desired one.
by:
sudo sed -E -i "" "s/^(define).*(${2})[\'|\"].*/${3}/g" "$file"
The issue is that on Ubuntu it’s failing due to extra space after i.
-i ""
If I remove that space it will work on Ubuntu but will not work on MacOS, e.g. giving an error.
sed: 1: "../config.php ...": invalid command code
What are the options for me to work this command across the *nix peacefully?
Thank you in advance for your time and knowledge.
I suspect you really mean
['\"], though.