I read that sed command sometime cant edit files that are links as lrwxrwxrwx 1 root root  Aug 31  2008 /etc/grub.conf -> ../boot/grub/grub.confso is it wrong to use sed assed -i 's/find/replace/g' /etc/grub.confor the right way is to works only on the non link file as ?sed -i 's/find/replace/g' /boot/grub/grub.conf
sed + update /etc/grub.conf in spite this link file
sed;rhel;grub;links
One reason to be careful with sed and symlinks, is that when sed modifies a file inplace, it will destroy the link and make a new file.  For example:bash-[622]$ echo abc > abash-[623]$ ln -s a bbash-[624]$ ls -latotal 32drwxr-xr-x   2 tim      staff        233 Mar  2 10:31 ./drwxrwxrwt   4 root     sys          612 Mar  2 10:29 ../-rw-r--r--   1 tim      staff          4 Mar  2 10:31 alrwxrwxrwx   1 tim      staff          1 Mar  2 10:31 b -> abash-[625]$ cat aabcbash-[626]$ cat babcbash-[627]$ sed -i 's/abc/def/g' bbash-[628]$ ls -latotal 32drwxr-xr-x   2 tim      staff        233 Mar  2 10:31 ./drwxrwxrwt   4 root     sys          612 Mar  2 10:29 ../-rw-r--r--   1 tim      staff          4 Mar  2 10:31 a-rw-r--r--   1 tim      staff          4 Mar  2 10:31 bbash-[629]$ cat aabcbash-[630]$ cat bdefIn order to work with symlinks in a safer manner, if your version of sed is GNU Sed, you can use the --follow-symlinks option of sed.bash-[632]$ echo abc > abash-[633]$ ln -s a bbash-[634]$ ls -latotal 32drwxr-xr-x   2 tim      staff        233 Mar  2 10:33 ./drwxrwxrwt   4 root     sys          612 Mar  2 10:32 ../-rw-r--r--   1 tim      staff          4 Mar  2 10:33 alrwxrwxrwx   1 tim      staff          1 Mar  2 10:33 b -> abash-[635]$ cat aabcbash-[636]$ cat babcbash-[637]$ sed --follow-symlinks -i 's/abc/def/g' bbash-[638]$ ls -latotal 32drwxr-xr-x   2 tim      staff        233 Mar  2 10:33 ./drwxrwxrwt   4 root     sys          612 Mar  2 10:32 ../-rw-r--r--   1 tim      staff          4 Mar  2 10:33 alrwxrwxrwx   1 tim      staff          1 Mar  2 10:33 b -> abash-[639]$ cat adefbash-[640]$ cat bdefAs you can see, when --follow-symlinks is used, the symlink is maintained, and the sed operation actually applies to file a.So, in your example, if you broke the symlink between /etc/grub.conf -> /boot/grub/grub.conf, you would expect your changes to take place, only to find out that they weren't actually being applied to /boot/grub/grub.conf, and you could spend significant time troubleshooting why your boot is not working as expected.