Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Dec 2007 22:21:22 +0200
From:      "Halid Faith" <maslak@ihlas.net.tr>
To:        <freebsd-questions@freebsd.org>
Subject:   Re: How to replace two strings in a file in the same time with sed command ?
Message-ID:  <001001c83c33$669b46b0$dc96eed5@ihlasnetym>
References:  <002801c83c11$cd434e70$dc96eed5@ihlasnetym> <475EC318.90104@dial.pipex.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Ok
But I have another problem,
I couldn't use any command  interior of sed command. That's to say I have a
script;

yy="file5"
 for i in `cat file1`;
 do
 sed -e 's/old1/new1\ \'$i'/g' -e 's/old2/'cut -d, -f 1 ${yy}'/g'   file2 >
file3
 done

When I run the script,  I get an error, due to using cut command



> Do you mean something like:
>
> sed -e 's/string1/replacement1/g' -e 's/string2/replacement2/g'
>
> or
>
> sed -f instructions.sed
>
> instructions.sed:
>
> s/string1/replacement1/g
> s/string2/replacement2/g
>
> --Alex
>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001001c83c33$669b46b0$dc96eed5>