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