Re: Automated Backup Script Help (Linux)

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Automated Backup Script Help (Linux)
Date: 2012-03-07 20:03:36
Message-ID: 4F57BF18.6000701@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2012-03-07 20:11:55 Re: [GENERAL] Altering a table with a rowtype column
Previous Message Szymon Guz 2012-03-07 20:00:41 Re: Show Databases via ODBC