I want to add some content to the end of line. below is the example.
created by imagebuilder
default=0
fallback=1
timeout=0
hiddenmenu
title Amazon Linux 2016.03 (4.4.11-23.53.amzn1.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-4.4.11-23.53.amzn1.x86_64 root=LABEL=/ console=tty1 console=ttyS0
initrd /boot/initramfs-4.4.11-23.53.amzn1.x86_64.img
I want to add transparent_hugepage=never
in the end of line which starts with kernel. Just like below
# created by imagebuilder
default=0
fallback=1
timeout=0
hiddenmenu
title Amazon Linux 2016.03 (4.4.11-23.53.amzn1.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-4.4.11-23.53.amzn1.x86_64 root=LABEL=/ console=tty1 console=ttyS0 transparent_hugepage=never
initrd /boot/initramfs-4.4.11-23.53.amzn1.x86_64.img
How to do that using sed command. I tried many posts on the site but none is working in my case.