Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2007 11:15:10 +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 withsed	command ?
Message-ID:  <003601c83c9f$7f229aa0$dc96eed5@ihlasnetym>
References:  <001001c83c33$669b46b0$dc96eed5@ihlasnetym> <20071211234633.GA3568@basement.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I tried it, but I get an error;

cut: boby, e, 656a, No such file or directory
cut: boby, e, 656a, No such file or directory
cut: allen, e, 987c, No such file or directory
cut: allen, e, 987c, No such file or directory
...

here's my script
for i in `cat file1` ; do
    sed -e "s/old1/new1 `cut -d, -f 1 ${file1}/g" -e "s/old2/`cut -d, -f 3
${file1}`/g" file2 > file3
done

when I run myscript I get an error as above.

-d option of cut command could not run.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003601c83c9f$7f229aa0$dc96eed5>