Re: Non-portable shell code in pg_upgrade tap tests

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tels" <nospam-pg-abuse(at)bloodgate(dot)com>
Cc: "Dagfinn Ilmari Mannsåker" <ilmari(at)ilmari(dot)org>, "Victor Wagner" <vitus(at)wagner(dot)pp(dot)ru>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Non-portable shell code in pg_upgrade tap tests
Date: 2018-07-21 23:20:08
Message-ID: 25533.1532215208@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Tels" <nospam-pg-abuse(at)bloodgate(dot)com> writes:
> Looking at your new patch, I notice you used "" for quoting, not ''. (Not
> sure which variant Tom used when pushing a patch).
> I'm not a shell expert, but I think '' are safer, as "" still has some
> interpolation from the shell (at least on the systems I use regulary):

We can't do that here because '' would suppress interpolation of the
variable's value, which is sort of the point.

AFAIK, the locution "$foo" is safe regardless of what is in $foo,
as long as only one pass of shell evaluation is involved. The shell
will treat the value of $foo as one not-further-interpreted command
argument.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-07-22 00:03:37 Re: Remove psql's -W option
Previous Message Vik Fearing 2018-07-21 22:51:05 Re: Remove psql's -W option