On Linux sed -i will modify the input files in place. It doesn’t work on Solaris, though.
sed -i '$ s/OLD/NEW/g' test
sed: illegal option -- i
What can I use in place of sed -i on Solaris?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ll need to replicate
-i‘s behavior yourself by storing the results in a temp file and then replacing the original file with the temp file. This may seem inelegant but that’s allsed -iis doing under the covers.If you care you could make it a bit more robust by using
mktemp: