Re: pg_ctl - tighten command parameter checking - Mailing list pgsql-hackers

From Oliver Elphick
Subject Re: pg_ctl - tighten command parameter checking
Date
Msg-id 1014072724.4369.2016.camel@linda
Whole thread Raw
In response to Re: pg_ctl - tighten command parameter checking  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On Mon, 2002-02-18 at 16:35, Peter Eisentraut wrote:
> Oliver Elphick writes:
> 
> > The attached patch improves the command parameter checking of pg_ctl.
> >
> > At present, there is nothing to check that the parameter given with a
> > parameter-taking option is actually valid.  For example, -l can be given
> > without a following logfile name; on a strict POSIX shell such as ash,
> > you will get a subsequent failure because of too many shifts, but bash
> > will let it pass without showing any error.  The patch checks that each
> > parameter is not empty and is not another option.
> 
> Isn't this problem present in all of our scripts?

Possibly, but this is the one where I had problems:-)  I'll look at
others when I get some time.

> Btw., you shouldn't use "cut" in portable scripts.  You could probably use
> "case" to do the matching you want.

What kind of an inadequate environment doesn't have cut?

OK. I'll redo it using case...esac.

NB. I saw a comment in this script about dirname's being non-portable.
But it uses basename.  Is that portable?

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
    "All we like sheep have gone astray; we have turned      every one to his own way; and the LORD hath laid on
himthe iniquity of us all."         Isaiah 53:6 
 



pgsql-hackers by date:

Previous
From: David Terrell
Date:
Subject: Re: Serious 7.2 issue (non quiet string truncation)
Next
From: "Christopher Kings-Lynne"
Date:
Subject: PostgreSQL talk at UWA