I need to replace / with \/ so my sed command doesn't fail, but I'm having problems.
Original Code:
produces the following error:
It's erroring when the base64 output has a / in it. So I changed it to this:
but I can't get it to work. So how can I replace / with \/ using tr?
Thanks,
Mike
Original Code:
Code:
subj_64=`base64.pl -f=subj.test`
sed -e "s/<SUBJ>/${subj_64}/" in.test > out.test
produces the following error:
Code:
sed: command garbled: s/<SUBJ>/UHJvYmxlbXMgd2l0aCBOSURBUSA4LjEgZG93bmxvYWQ/Cg==/
It's erroring when the base64 output has a / in it. So I changed it to this:
Code:
subj_64=`base64.pl -f=subj.test | tr / \\\/`
sed -e "s/<SUBJ>/${subj_64}/" in.test > out.test
but I can't get it to work. So how can I replace / with \/ using tr?
Thanks,
Mike