How to remove plank spaces at the end of lines

Hello friends,

I want to remove blank spaces at the end of lines. I use sed command to do this but it is not working correctly.
sed �s/ $//� file_name

Can some body tell me what is the proper way to remove blank spaces at the end of a limes.

Thanks,
Mahesh Fernando.

You should output the results to some file. Only then can you see the changes.

sed -e 's/ *$//g' file_name > file_name.temp
mv file_name.temp file_name

Are you redirecting your output to another file? That command won't change the file itself.

Friends,

Thanks for the correction.

I am rederectiong the file. given syntax is working fine.

Thanks,
Mahesh.