[NTLUG:Discuss] 'Smart quotes' in a konsole window
Kenneth Loafman
kenneth at loafman.com
Sun May 31 10:31:19 CDT 2009
Leroy Tennison wrote:
> Does anyone know how you get these when working in konsole? I was doing
> the following and wondering why it didn't work (thought I was either
> going crazy or totally misunderstanding regular expressions):
>
> grep “\(first\|third\)” test3
>
> It wasn't until I did:
>
> grep "\(first\|third\)" test3
>
> and saw it work that I started comparing the two and noticed the
> difference in the double quote characters. Unfortunately I had no idea
> how I entered them originally (I wasn't doing anything special that I
> knew I was doing). I did copy/paste both lines into a file and look at
> it with hexdump. The first quote is a multibyte sequence (e2 80 9c) and
> the second is a single byte (22). Another point is that, in konsole,
> the 'Smart Quotes' don't look at they appear above (in my Thunderbird
> composition window, I hope emailing this doesn't cause 'conversions' to
> take place). The first 'Smart Quote' looks like two commas
> superscripted and turned upside down, the second 'Smart Quote' looks
> like two commas superscripted but not turned upside down. You get the
> same look in OpenOffice.org Writer 3.01 when you use double quotes.
Had the same thing happen to me when I copied a script out of an email.
Turns out that in the shell: export foo="bar"
sets foo to "bar" if the quotes are "smart" quotes, bar (no quotes) with
normal quote marks.
Beware of UTF8 file types. They should be considered dangerous for
shell programming, but even IDE's like Eclipse default to UTF8, so
caution is needed when working with shell scripts.
...Ken
More information about the Discuss
mailing list