Hi,
i have a script to replace a string.
$ cat List.txt
/DIR1/DIR2/DIR3/abcdefgh
/DIR1/DIR2/DIR3/abcd
/DIR1/DIR2/DIR3/abcdefghijk
/DIR1/DIR2/DIR3/xyz
$ ind=`/DIR1/DIR2/DIR3/abcd`
$ replace=`#/DIR1/DIR2/DIR3/abcd`
$ sed "s|$find|$replace|g" List.txt>cat NewList.txt
The aim of above 3 lines are to modify the line /DIR1/DIR2/DIR3/abcd as #/DIR1/DIR2/DIR3/abcd.
but the its replacing the 3 lines as bellow
$ cat NewList.txt
#/DIR1/DIR2/DIR3/abcd
#/DIR1/DIR2/DIR3/abcdefgh
#/DIR1/DIR2/DIR3/abcdefghijk
/DIR1/DIR2/DIR3/xyz
i has to replace only one line.
help me in solving this problem.
Thanks in advance.
~Saravana..