Re: Automated Backup Script Help (Linux) - Mailing list pgsql-general

From John R Pierce
Subject Re: Automated Backup Script Help (Linux)
Date
Msg-id 4F57BF18.6000701@hogranch.com
Whole thread Raw
In response to Re: Automated Backup Script Help (Linux)  (Carlos Mennens <carlos.mennens@gmail.com>)
List pgsql-general
On 03/07/12 11:20 AM, Carlos Mennens wrote:
> SCRIPTPATH=$(cd ${0%/*}&&  pwd -P)

thats line 7 by my count.


thats some very strange stuff there.  AFAIK ${0%/*}  means, take $0
which is the name of the invoking command ('sh' in the invocation you
gave), match and remove the results of the pattern  /*

I think you're NOT supposed to invoke this script with `sh scriptname`
but instead invoke it as 'path/to/scriptname' (thereforce, it has to be
chmod +x).  if it was invoked as ./script, then it would cd ., and set
SCRIPTPATH to the full path of .

again, this is a linux shell issue, has nothing to do with postgres,
regardless of the rest of the script.







--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast


pgsql-general by date:

Previous
From: Szymon Guz
Date:
Subject: Re: Show Databases via ODBC
Next
From: Merlin Moncure
Date:
Subject: Re: Altering a table with a rowtype column