Mailinglist Archive: opensuse (2488 mails)

< Previous Next >
Re: [opensuse] Bash script help needed
  • From: Brian Jackson <brian@xxxxxxxxxxxxxxxxxxxxx>
  • Date: Mon, 5 Feb 2007 11:09:14 -0800
  • Message-id: <200702051109.15958.brian@xxxxxxxxxxxxxxxxxxxxx>
On Monday 05 February 2007 11:01, Jan Karjalainen wrote:
> Somehow all these examples add the ",on" on a new line after each
> line, like this:
>
> 208.34.234.48-208.34.234.63
> ,on
> 208.34.235.32-208.34.235.63
> ,on
> etc...
>
> I want them to look like this:
> 208.34.234.48-208.34.234.63,on
> 208.34.235.32-208.34.235.63,on
> etc...

Did your input file come from a DOS (ie windos) computer?

The sed examples work just as well as the perl on I mentioned. if your
file does have ^M's in it, you can strip them with this

perl -pi -e 's/^M//g; s/$/,on' FILE

good luck
--
Brian Jackson Photo
Sports ~ People ~ Events
http://www.BrianJacksonPhoto.com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups