Thread: pgsql/src/bin/pg_ctl pg_ctl.sh

pgsql/src/bin/pg_ctl pg_ctl.sh

From
Bruce Momjian - CVS
Date:
CVSROOT:    /home/projects/pgsql/cvsroot
Module name:    pgsql
Changes by:    momjian@hub.org    01/07/11 12:16:53

Modified files:
    src/bin/pg_ctl : pg_ctl.sh

Log message:
    Move export PGDATA to the proper place.  Quote some variable substitutions.


Re: pgsql/src/bin/pg_ctl pg_ctl.sh

From
Peter Eisentraut
Date:
Bruce Momjian - CVS writes:

> CVSROOT:    /home/projects/pgsql/cvsroot
> Module name:    pgsql
> Changes by:    momjian@hub.org    01/07/11 12:16:53
>
> Modified files:
>     src/bin/pg_ctl : pg_ctl.sh
>
> Log message:
>     Move export PGDATA to the proper place.

This is completely broken.  The old place was right.

> Quote some variable substitutions.

You don't need to quote the argument to 'case'.  Please don't do that, it
makes things less readable.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Re: pgsql/src/bin/pg_ctl pg_ctl.sh

From
Bruce Momjian
Date:
> Bruce Momjian - CVS writes:
>
> > CVSROOT:    /home/projects/pgsql/cvsroot
> > Module name:    pgsql
> > Changes by:    momjian@hub.org    01/07/11 12:16:53
> >
> > Modified files:
> >     src/bin/pg_ctl : pg_ctl.sh
> >
> > Log message:
> >     Move export PGDATA to the proper place.
>
> This is completely broken.  The old place was right.

Can you explain. Do we not want to export PGDATA for other programs we
run from this script?

> > Quote some variable substitutions.
>
> You don't need to quote the argument to 'case'.  Please don't do that, it
> makes things less readable.

Well, I guess.  I usually quote all variable mentions.  I saw lots of
VAR=$1 which should be VAR="$1", right?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: pgsql/src/bin/pg_ctl pg_ctl.sh

From
Peter Eisentraut
Date:
I wrote:

> >     Move export PGDATA to the proper place.
>
> This is completely broken.  The old place was right.

Correction:  The new place also seems to be okay, but 'export VAR=stuff'
is not portable,  You need to split it into two commands.

> > Quote some variable substitutions.
>
> You don't need to quote the argument to 'case'.  Please don't do that, it
> makes things less readable.

Also, you don't need to quote the right side of

FOO=$BAR

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Re: pgsql/src/bin/pg_ctl pg_ctl.sh

From
Bruce Momjian
Date:
> I wrote:
>
> > >     Move export PGDATA to the proper place.
> >
> > This is completely broken.  The old place was right.
>
> Correction:  The new place also seems to be okay, but 'export VAR=stuff'
> is not portable,  You need to split it into two commands.

Oh, yes you are totally correct.  I am forgetting my old shell stuff.

>
> > > Quote some variable substitutions.
> >
> > You don't need to quote the argument to 'case'.  Please don't do that, it
> > makes things less readable.
>
> Also, you don't need to quote the right side of
>
> FOO=$BAR

That is interesting.  I just tried:

    #$ X="1 2"
    #$ Y=$X
    #$ echo $X
    1 2

When do I need quotes around variables then?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026