]OT] Parsing postgresql.conf archive_command

Поиск
Список
Период
Сортировка
От Joey K.
Тема ]OT] Parsing postgresql.conf archive_command
Дата
Msg-id 467669b30810030605x79d595c4m49827a35e2f3129a@mail.gmail.com
обсуждение исходный текст
Ответы Re: ]OT] Parsing postgresql.conf archive_command  (Erik Jones <ejones@engineyard.com>)
Список pgsql-general
Hello,


I'd like to get the path configured for archive_command in a shell script

I've used a file with following content as an example (postgresql.conf),

# archive_command = cp %p /backup/%r
  # archive_command = cp %p /backup/%r
        # archive_command = cp %p /backup/%r
#archive_command = cp %p /backup/%r
   archive_command = 'cp %p /backup/wal/%f'

This is what I been trying.
$ awk '!/[ \t]*#/ { sub(/%f$/, "", $NF); print $NF }' postgresql.conf

and I get
/backup/wal/%f'

Any idea how to get rid of "%f'"  so that I get only?
/backup/wal/

My regexp skills are sad :-)

Steve

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

Предыдущее
От: "Anderson dos Santos Donda"
Дата:
Сообщение: INITDB in VISTA
Следующее
От: bull@pubbs.net
Дата:
Сообщение: