Mailinglist Archive: opensuse (2488 mails)

< Previous Next >
Re: [opensuse] Bash script help needed
  • From: Randall R Schulz <rschulz@xxxxxxxxx>
  • Date: Mon, 5 Feb 2007 10:53:17 -0800
  • Message-id: <200702051053.17926.rschulz@xxxxxxxxx>
On Monday 05 February 2007 10:25, Anders Johansson wrote:
> On Monday 05 February 2007 19:15, Jan Karjalainen wrote:
> > How do I go through a text file and add ",on" at the end of each
> > line?
>
> ...
>
> or, if you want to make the changes directly in the file
>
> sed -ie 's/\(.*\)/\1,on/g' testfile

D'Oh!

Well, it's good to learn that sed has an in-place editing option. It's
also nice to know it can optionally make a back-up before overwriting
the original:

-i[SUFFIX], --in-place[=SUFFIX]

edit files in place (makes backup if extension supplied)



RRS
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >