Re: Petition: Treat #!... shebangs as comments

Поиск
Список
Период
Сортировка
От Frank Pinto
Тема Re: Petition: Treat #!... shebangs as comments
Дата
Msg-id CAATpuJqBfmOibXFxReEa-d16qEnhsc6A1SK9Ek9MMijdQbBWHw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Petition: Treat #!... shebangs as comments  (Martin Gudmundsson <martingudmundsson@gmail.com>)
Ответы Re: Petition: Treat #!... shebangs as comments
Список pgsql-general
I personally like Francisco Olarte's approach. Hashbang's don't support arguments well (http://stackoverflow.com/questions/4303128/how-to-use-multiple-arguments-with-a-shebang-i-e) and being able to put JUST psql as the command to execute the script doesn't scale across environments. Previously I've just used a quick wrapper:

https://gist.github.com/frankpinto/3427cf769a72ef25ffac

It can be modified to accept arguments for the script name, run a sql script by the same name, have a default environment, etc.

Frank


On Fri, Jul 18, 2014 at 10:43 AM, Martin Gudmundsson <martingudmundsson@gmail.com> wrote:
+1

Skickat från min iPhone

> 18 jul 2014 kl. 17:58 skrev Adrian Klaver <adrian.klaver@aklaver.com>:
>
>> On 07/18/2014 08:52 AM, Karsten Hilbert wrote:
>> On Fri, Jul 18, 2014 at 08:32:53AM -0700, Adrian Klaver wrote:
>
>>
>> I think the OP is talking about executable scripts so both of
>>
>>    $> psql -f the-file.sql
>>
>> and
>>
>>    $> ./the-file.sql
>>
>>    (where the-file.sql starts with "#!/usr/bin/env psql")
>>
>> would work given that the-file.sql has got execute permission.
>
> Yea, it finally dawned on me what was being asked, so ignore my previous post.
>
>>
>> Karsten
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

В списке pgsql-general по дате отправления:

Предыдущее
От: David G Johnston
Дата:
Сообщение: Re: [ADMIN] Editable Views
Следующее
От: David G Johnston
Дата:
Сообщение: Re: Petition: Treat #!... shebangs as comments