Re: Non-portable shell code in pg_upgrade tap tests - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Non-portable shell code in pg_upgrade tap tests
Date
Msg-id 25533.1532215208@sss.pgh.pa.us
Whole thread Raw
In response to Re: Non-portable shell code in pg_upgrade tap tests  ("Tels" <nospam-pg-abuse@bloodgate.com>)
List pgsql-hackers
"Tels" <nospam-pg-abuse@bloodgate.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


pgsql-hackers by date:

Previous
From: Vik Fearing
Date:
Subject: Re: Remove psql's -W option
Next
From: Tom Lane
Date:
Subject: Re: Remove psql's -W option