I copied text from a PDF file in bash - vi
and I get lines like this:
echo <93>The Hypotenuse is $hypotenuse<94>
I tried to change that in vi
by:
s/<93>/"/g
But:
E486: Pattern not found: <93>
And by sed
:
sed 's/'`echo "\093"`'/"/g' par.sh
And:
sed 's/'`echo "\094"`'/"/g' par.sh
And:
sed 's/\<93\>/\"/g' aa.sh
echo В“The Hypotenuse is $hypotenuseВ”
Could you tell me what I should use?
vi
approach should have worked. If it didn't, you have non-printing characters. Could you show us the actual file?<93>
stuffs are not colored invi
. If they are, they must be hex-encoded unprintable characters. And your approach usingecho
is badly wrong -- You should use-e
for backslash escapes, and\0oo
is actually octal. The final resulting command would besed -i.bak -e s/[$(echo -e '\x93')$(echo -e '\x94')]/\"/g par.sh
.