0

So, I am trying to change directories using sed, but I can't seem to get the find and replace to work.

I am inputting

d="D:\X-docs\X\"
echo $d
p=$(pwd)
f=${p}"/"

and I am getting the correct output of

D:\X-docs\X\

but when I use

sed -i "s|${d}|${f}|g" $file

$d is not getting replaced with $f, but no error is being displayed indicating there was an incomplete sed command.

The line it should be replacing in the file is

%chk=D:\X-docs\X\abc_1.gjf

I have also tried setting $d to:

d="D:\X-docs\X\\"
d=D:\\X-docs\\X\\

0 Answers0