Solve the problem of sed command error report under Mac

To prepare to replace some text in batches on the Mac, use the sed command, as follows:

sed -i 's/xxx/yyy/g' file

The same command can be successfully run on Linux, pay attention to the description of the -i parameter in man sed under Mac:

It turned out to be a Mac's backup requirement, alright! Then do it like this:

sed -i '' 's/xxx/yyy/g' file

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324847735&siteId=291194637