Re: Bash function from psql (v14)

Поиск
Список
Период
Сортировка
От Greg Sabino Mullane
Тема Re: Bash function from psql (v14)
Дата
Msg-id CAKAnmmL2ib1=-x-kpqaWPL6RoLa4qbeFWAeSGEB5SZ2pyeTLPA@mail.gmail.com
обсуждение исходный текст
Ответ на Bash function from psql (v14)  (Murthy Nunna <mnunna@fnal.gov>)
Ответы RE: Bash function from psql (v14)
Список pgsql-general
What problem are you trying to solve? If you tell us that, we can guide you to some better solutions.

There are numerous issues here, but the most important are:

1) Calling a shell via \! invokes an entirely new process: there is no link to the parent or grandparent process

2) The run-bash-function must be declared before being called, so that bash code was never going to work anyway. In other words, this is valid:

run-bash-function() { echo "Here we are"; }

run-bash-function

This version is not:

run-bash-function

run-bash-function() { echo "Here we are"; }


Cheers,
Greg

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