Re: initdb and "exit_nicely"...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Lincoln Yeoh <lylyeoh(at)mecomb(dot)com>, Andrew Sullivan <sullivana(at)bpl(dot)on(dot)ca>, Len Morgan <len-morgan(at)crcom(dot)net>, pgsql-general(at)hub(dot)org
Subject: Re: initdb and "exit_nicely"...
Date: 2000-05-25 23:56:37
Message-ID: 862.959298997@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> How do you find out if a directory is empty?

Good question.

> The best way I could think of is this:

> test x"`ls -A "$PGDATA"`" = x

The embedded quotes might confuse some shells, no? Perhaps better
CONTENTS=`ls -A "$PGDATA"`
if test "x$CONTENTS" = x

> Are we talking 7.0.1 material, btw?

Well, we would be if we were sure of the patch. I'm a little worried
about portability though. Given that this isn't a very critical issue
(IMHO) I'd recommend saving it for the 7.1 cycle.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marcin Inkielman 2000-05-26 00:06:07 Re: PG 7.0 vacuum problem
Previous Message Peter Eisentraut 2000-05-25 23:53:14 Re: initdb and "exit_nicely"...