How to replace two strings in a file in the same time withsed command ?

Halid Faith maslak at ihlas.net.tr
Wed Dec 12 01:15:19 PST 2007


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.





More information about the freebsd-questions mailing list