Re: [HACKERS] Re: initdb.sh fixed - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Re: initdb.sh fixed
Date
Msg-id 199912200538.AAA28874@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Re: initdb.sh fixed  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > We currently have:
> >   EffectiveUser=`id -n -u 2>/dev/null` || EffectiveUser=`whoami 2>/dev/null`
> 
> OK, but is that really portable?  I'd feel more comfortable with
> 
> EffectiveUser=`id -n -u 2>/dev/null || whoami 2>/dev/null`
> 
> because it's clearer what will happen.  I wouldn't have expected an
> error inside a backquoted subcommand to determine the error result of
> the command as a whole, which is what the first example is depending on.
> In a quick test it seemed to work with the ksh I tried it on, but I
> wonder how many shells work that way...

Change applied.

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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: initdb.sh fixed
Next
From: Tatsuo Ishii
Date:
Subject: Re: [HACKERS] Re: Notation for nextval() (was Re: Several small patches)