Re: Petition: Treat #!... shebangs as comments - Mailing list pgsql-general

From John McKown
Subject Re: Petition: Treat #!... shebangs as comments
Date
Msg-id CAAJSdjit7L9E-BNK4ch2tGd78BSEH1aMb1cBZLHtskYp9DUpJg@mail.gmail.com
Whole thread Raw
In response to Re: Petition: Treat #!... shebangs as comments  (Andrew Pennebaker <andrew.pennebaker@gmail.com>)
Responses Re: Petition: Treat #!... shebangs as comments  (Francisco Olarte <folarte@peoplecall.com>)
List pgsql-general
On Fri, Jul 18, 2014 at 2:37 PM, Andrew Pennebaker
<andrew.pennebaker@gmail.com> wrote:
> As a workaround, I can use this shebang hack:
>
> $ cat hello.psql
> --() { :; }; exec psql -f "$0"

I hope that isn't patented! <grin?> "Cause I'm gonna use it when I need to.

>
> SELECT 'Hello World!';
>
> $ ./hello.psql
>    ?column?
> --------------
>  Hello World!
> (1 row)
>
> $ psql -f hello.psql
>    ?column?
> --------------
>  Hello World!
> (1 row)
>
> But I would prefer to use a traditional (#!/usr/bin/env psql -f) shebang. It
> took a few hours on irc to hack this one together.

FWIW - I like #! also. Even though it may cause the Windows users to
want something equivalent. Assuming there are any Windows people who
really use a command prompt.

--
There is nothing more pleasant than traveling and meeting new people!
Genghis Khan

Maranatha! <><
John McKown


pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: Petition: Treat #!... shebangs as comments
Next
From: Tom Lane
Date:
Subject: Re: Petition: Treat #!... shebangs as comments