Skip to content
Advertisement

Shell script to edit and add a entry in file

Could any one help me to add entry at the end of the line.

This is linux os.

Below is the contents of the file /boot/grub2/grub.cfg

JavaScript

I need to add entry at the end of the line “text1” and “text2”.

JavaScript

after edit my file should look like:

JavaScript

Advertisement

Answer

With sed expression:

JavaScript
Advertisement