From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | Justin <justin(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Patches Mailing List <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: More fixes for missing double quotes in the shell |
Date: | 2001-09-30 00:01:38 |
Message-ID: | 200109300001.f8U01cH09255@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
> Justin writes:
>
> > I agree it's not strictly necessary, but I thought I'd add them in to
> > follow the generic "good programming practise" of always quoting
> > variables in shell script tests.
>
> In my purely personal opinion it's better to be aware of the possible
> values of a variable than to blindly quote everything. Somewhere you're
> going to run into nested quote situations which cannot be done portably,
> at which point you have to start doing that anyway.
I am not good at remembering what could be in a variabe. I find it
easier to just quote everything. If I have embedded quotes, I do
"\"$X\"". That requires fiddling less often than having values that
need/don't need quote protection.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2001-09-30 00:04:35 | Re: Trailing semicolons in psql patch |
Previous Message | Peter Eisentraut | 2001-09-29 22:54:53 | Re: Trailing semicolons in psql patch |