when specifying "shell" in vtc, can we require posix /bin/sh ? or is it by
chance ?

shell {
    HOST=${h1_fe1_addr}
    if [ "${h1_fe1_addr}" = "::1" ] ; then
        HOST="\[::1\]"
    fi

    md5=$(which md5 || which md5sum)


вт, 18 февр. 2020 г. в 18:24, Willy Tarreau <w...@1wt.eu>:

> On Tue, Feb 18, 2020 at 02:15:18PM +0100, Tim Düsterhus wrote:
> > Willy,
> >
> > Am 18.02.20 um 14:06 schrieb Willy Tarreau:
> > > I haven't pushed yet Ilya's patch I've just merged, I'm fine with
> > > applying a change if preferred. Just let me know.
> >
> > `type` is required to be a builtin by POSIX [1]. The `-p` parameter does
> > not appear to be standardized, though. Nonetheless I expect it to work
> > in any `bash`.
>
> OK thanks for the info. But sadly it fails in other shells such as dash:
>
>   $ type -p curl
>   -p: not found
>   curl is /usr/local/bin/curl
>
> So we can only use "type" with no argument and adjust it. Or better,
> we can use "command -v" which looks OK:
>
>   bash$ command -v curl
>   /usr/local/bin/curl
>   dash$ command -v curl
>   /usr/local/bin/curl
>   ksh$ command -v curl
>   /usr/local/bin/curl
>
> And it's also in POSIX:
>    https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
>
> Willy
>

Reply via email to