[lug] delete last character of every line

Jani Averbach jaa at jaa.iki.fi
Wed Mar 23 15:49:30 MST 2005


On 2005-03-23 14:33-0700, Shannon Johnston wrote:
> Once again, I'm stuck with a little problem.
> I've got a list of 6000 ip addresses in a text file, all of them have a
> trailing ".". I need to get rid of that before it becomes useful.
> 
> Does anybody know how to do that? Either in vi or as a sed command?

echo '192.168.3.42.' | sed 's@\(.*\)\.$@\1@'

BR, Jani

-- 
Jani Averbach



More information about the LUG mailing list