I wish to append ” dddd” to the next line whenever I encounter “=” in a textfile.
This command
sed -i '/=/s|$| dddd|' *.krn
is close to what I am looking for as it appends to the current line where “=” is. How can I append to the next line instead?
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.
Use append, see here:
E.g.:
Edited to clarify as per comment from @je4d- if you want to append to what is present in the next line, you can use this:
See here for a great sed cheatsheet for more info if you want: