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

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: Petition: Treat #!... shebangs as comments
Дата
Msg-id 20140718194732.GB3259@hermes.hilbert.loc
обсуждение исходный текст
Ответ на Re: Petition: Treat #!... shebangs as comments  (Francisco Olarte <folarte@peoplecall.com>)
Ответы Re: Petition: Treat #!... shebangs as comments
Список pgsql-general
On Fri, Jul 18, 2014 at 05:51:35PM +0200, Francisco Olarte wrote:

> Anyway, this is a little bit complex, as psql many times needs arguments.

Agreed.

> > Could we please have the PostgreSQL lexer treat #!... on the first line of a
> > file as a comment? This would enable .psql scripts to be run with dot-slash
> > notation
...
> It's been pointed it can be done with a shell script. If you can live
> with a little noise you can have it dual ( The \r makes it ignore the
> previous lines, the \q makes it exit before reading the EOF line ):
>
> ~/tmp $ cat kk.sql
> #!/bin/bash
> psql service=redacted <<EOF
> \r
> select 2*3*7;
> \q
> EOF

Nice solution but that won't work on Windows ...

Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


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

Предыдущее
От: Karsten Hilbert
Дата:
Сообщение: Re: Petition: Treat #!... shebangs as comments
Следующее
От: John McKown
Дата:
Сообщение: Re: Petition: Treat #!... shebangs as comments