Hi guys
Here is a weird one...at least for me.
i have a test file where some lines contain the world e-mail followed by some e-mails. I want to remove the last comma (,) character of each of these lines .
I can do this with the below command
Code:
cat test.txt |grep emails|sed 's/,$//'
emails=
emails=
emails= test3@mail.com, testmail@mail.com,test2@mail.com
emails=
The above command does not save the result so when i add the "-i" on the sed command i get the following error:
Code:
cat test.txt|grep emails|sed -i 's/,$//'
sed: no input files
Thats quite normal since the data were piped to sed and were not given from a file in order for sed to save the changes.
How do you overcome this one? Any ideas?
Thanks