Re: [PATCH] check for ctags utility in make_ctags
| От | Andrew Dunstan |
|---|---|
| Тема | Re: [PATCH] check for ctags utility in make_ctags |
| Дата | |
| Msg-id | 249c110c-1a30-87bf-2bb8-bc84265c1eeb@2ndQuadrant.com обсуждение исходный текст |
| Ответ на | Re: [PATCH] check for ctags utility in make_ctags (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: [PATCH] check for ctags utility in make_ctags
|
| Список | pgsql-hackers |
On 1/6/19 12:16 PM, Tom Lane wrote:
>
> The correct way to code this is to depend on the exit code,
> not the text output:
>
> if command -v etags >/dev/null
> then
> : ok
> else
> echo etags not found
> exit 1
> fi
more succinctly,
command -v etags >/dev/null || { echo etags not found; exit 1;}
> We could alternatively try to use "which" in the same way,
> but I'm dubious that it's more portable than "command".
> (AFAICT, "which" is *not* in POSIX.)
>
>
Indeed. I know I have some systems where it's lacking.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: