N/APosted on - 10/04/2011
I have two source codes, older and newer version. I can easily find trailing blanks in the older version but was unable to remove them. So please tell me that is there any way to remove trailing blanks in Unix based operating system. If yes how can I do it?
How can i remove trailing blanks?
Hi, first for your record, any file in Linux based systems can be manually edited, and that is one of the strength points of this cool OS. Now lets go back to your issue, you said that you can find what you want to remove but the problem is that you can't remove it. Well, this is due to the file permission, the file you are welling to edit is not yours, in other terms you did not create this file, so in your case only the owner of the file have the permission to edit it. What you need to do is to change the permission of the file :
$ sudo chmod o+w file_name_goes_here
to explain further: because you are not the owner of the file, you are considered in the file permission hierarchy as to be from the "others " category that's why we added the o flag , then we added the write (w) permission to this category, so that you get the possibility to edit the file
other possible solution open the file in edit mode with root privileges, this may solve the problem
hope this is helping!!