On Mon, 2 Dec 2002, [iso-8859-9] Malik B�lent wrote:

> 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 ?

Unfortunately I deleted your other mail, asking how to remove lines
containing some text in a file, but this might be one of many
solutions:

# perl -e 'open(FD,"<file"); while(<FD>) { if(!($_ =~ /texttolookfor/)) { print "$_"; 
}} close(FD);' > file.tmp

This has not been tested, so use it at your own risk. :-)

Best regards,
Paul



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to