On 02-Dec-2002 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 ?
Recent versions of FreeBSD now have a version of 'sed' that can do these types of replacements "in place", i.e., without the need for a temporary file: sed -i -e 's/^touch /rm /' infile That were a easy one. :-) -- Conrad Sabatier <[EMAIL PROTECTED]> To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
