Mailinglist Archive: opensuse (2488 mails)

< Previous Next >
Re: [opensuse] Bash script help needed
  • From: Anders Johansson <andjoh@xxxxxxxxxx>
  • Date: Mon, 5 Feb 2007 19:25:38 +0100
  • Message-id: <200702051925.38090.andjoh@xxxxxxxxxx>
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?

Does it have to be in bash?

sed -e 's/\(.*\)/\1,on/g' filename

or, if you want to make the changes directly in the file

sed -ie 's/\(.*\)/\1,on/g' testfile

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

< Previous Next >
Follow Ups
References