My target is to add remark “#” before the “dialog” string
only in line that has the “Restart nfs and apply changes” line
Why my sed command not add the “#” char before the dialog string? , what wrong? In my syntax?
sed -i -r '/Restart nfs and apply changes/s/dialog ?$/#dialog/' /etc/init.d/nfsscript.sh
the line in /etc/init.d/nfsscript.sh file :
dialog --clear --colors --title "nfs Config" --yesno "Restart nfs and apply changes?" 10 20
This might work: