0

I'm new to bash scripting (and Linux at the same time)... but to save some time on building servers at the Office I'm trying to automate some of the configuration through a bash script.

So far I've found what I'm looking for except for that one question... I'm in need to add some text in a specific location in a file. I need to add elevator=noop like in this example:

crashkernel=auto elevator=noop

How can I proceed to do this in a Bash Script under Linux.

1 Answer 1

5

if you have sed

sed -i.bak 's/crashkernel=auto/& elevator=noop/' file

will save the old file as file.bak and update the input file inplace

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you... ill add it to my script on Monday.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.