[exim] Re: Best way to split multiline string

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Kirill Miazine
Date:  
À: exim-users
Sujet: [exim] Re: Best way to split multiline string


• Ian Z via Exim-users [2024-10-13 17:49]:
> On Sun, Oct 13, 2024 at 11:51:31AM GMT, Evgeniy Berdnikov via Exim-users wrote:
>
>>> I need to inspect the output from en external program (run via the
>>> ${run} expansion). The program outputs multiple lines, only the
>>> first is relevant to me. What is the least painful way to extract
>>> it? I mean the least number of backslashes and curlies.
>
>> Use ${run} to start shell wrapper with "head -1",
>> or simply feed 'command "$@" | head -1' line to shell.
>
> This is what I came up with, myself. Thanks :-)


in these cases Exim wouldn't know if/when the command fails, though
(unless some workarounds are made to let Exim know the exit code of the
external program in question, which make the solution rather painful as
the result)

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/