Im trying to use sed to add a line after a specific string in a file. Can anyone help?
File name:
example.js
Existing line:
localeData: require('react-intl/locale-data/en'),
Desired output:
localeData: require('react-intl/locale-data/en'),
messages: require('../locale/messages_en'),
UPDATE: Some progress, this command replaces the string being searched with the string I want appended.I don't want it replaced:
sed 's/react-intl\/locale-data\/en/..\/locale\/messages_en/g' example.js