From: Colin Patrick Mccabe Date: Mon, 28 Jan 2013 23:37:07 +0000 (-0800) Subject: ascii-tyrant.sh: handle e2 80 98, use sed with g X-Git-Url: http://www.club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbcac7311450e58fe9b7b0d80833f70d1b4844f7;hp=c1056cd0234a05046eba6eb232279aa9e3dc248b;p=cmccabe-bin ascii-tyrant.sh: handle e2 80 98, use sed with g handle 0xe2 0x80 0x98, which seems to appear in place of space when cutting-and-pasting from certain PDFs. Use sed 's/../.../g' so that all instances of the bad pattern are replaced. Signed-off-by: Colin McCabe --- diff --git a/ascii-tyrant.sh b/ascii-tyrant.sh index 62eee66..1c01966 100755 --- a/ascii-tyrant.sh +++ b/ascii-tyrant.sh @@ -6,10 +6,11 @@ # 4. translate curly start double quotes into regular double quotes # 5. translate curly end double quotes into regular double quotes cat | \ -sed "s/\xe2\x80\x98/'/" | \ -sed "s/\xe2\x80\x99/'/" | \ -sed "s/\xe2\x80\x93/--/" | \ -sed 's/\xe2\x80\x9c/"/' | \ -sed 's/\xe2\x80\x9d/"/' | \ +sed "s/\xe2\x80\xa9/ /g" | \ +sed "s/\xe2\x80\x98/'/g" | \ +sed "s/\xe2\x80\x99/'/g" | \ +sed "s/\xe2\x80\x93/--/g" | \ +sed 's/\xe2\x80\x9c/"/g' | \ +sed 's/\xe2\x80\x9d/"/g' | \ cat -