I have two files: unknown.csv
contains
aaa
bbb
ccc
and another file 01.txt
as
;lksdjflk aaa lkdsfjdlk
aaa|xxlkjasd|
|sadkl;k|lsa;dkl
when I define a variable as j=aaa
and try
sed "s/${j}//g" 01.txt
it will find occurrences of aaa
and remove it. But if I try to read the j
from the unknown.csv
as
j=$(sed '1q;d' unknown.csv)
and try
sed "s/${j}//g" 01.txt
nothing happens. echo $j
for both cases show same result of aaa
.
The goal is to read a variable from the unknow.csv
file and use it to replace it in 01.txt
file.
Thanks