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.
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.