sed 's/^MOZ_ARCH=.*/#& MOZ_ARCH=$(i686)/' /usr/bin/firefox
But I can't tell what you really want. Do you want to change the value after MOZ_ARCH= or add another MOZ_ARCH entry?
Please post the actual line and how you want it to change.
Or do you want to add MOZ_ARCH=$(i686) on the next line?
Code:
cat tempfile
MOZ_ARCH=$(x86_64)
MOZ_LIB=/usr/lib
jschiwal@hpamd64:~> sed '/^MOZ_ARCH/{s//#&/
a\
MOZ_ARCH=$(x86)
}' tempfile
#MOZ_ARCH=$(x86_64)
MOZ_ARCH=$(x86)
MOZ_LIB=/usr/lib
Without the -i option the file isn't actually changed but just displayed. Either redirect the file to a temp file and then replace the current file or use the -i option. I'd recommend not using -i until after you are sure the sed command does what you want. Also backup the original just in case.