Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Dec 2002 07:43:44 -0500
From:      "Alan Day" <alanday@aaahawk.com>
To:        =?iso-8859-9?Q?Malik_B=FClent?= <bmalik@ihlas.net.tr>, <questions@freebsd.org>
Subject:   Re: is there a "replace command" ? 
Message-ID:  <001a01c29a00$74813ee0$7800000a@a>
References:  <012401c299fc$ed221f80$dc96eed5@ymmaslak>

next in thread | previous in thread | raw e-mail | index | archive | help
sed -e 's/touch/rm/' FILENAME > OUTPUT_FILE

or something like,

perl -pi -e 's/touch/rm/;' FILENAME

man 1 sed for a lot more detail

----- Original Message -----
From: "Malik Bülent" <bmalik@ihlas.net.tr>
To: <questions@freebsd.org>
Sent: Monday, December 02, 2002 7:18 AM
Subject: is there a "replace command" ?


> On Freebsd4.x
> I have a file. I want to change some expressions with new ones
> For example a file
> touch  /var/qmail/1
> touch  /var/qmail/2
> touch  /var/qmail/3
> touch  /var/qmail/4
> touch  /var/qmail/5
> touch  /var/qmail/6
> I want to change "touch" with "rm"
> How can i replace a newones in stead of a lot of  expressions in a file on
> FreeBSD ?
> Which command(s) do i have to use ?
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001a01c29a00$74813ee0$7800000a>