chiark / gitweb /
dot/profile (__mdw_programp): Use `command -v' rather than `type'.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 11 Jul 2024 11:22:27 +0000 (12:22 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 11 Jul 2024 11:22:27 +0000 (12:22 +0100)
POSIX specifies the exit status for the former but not the latter.

dot/profile

index f8d4dc9635431e07180f694a5f6c1d5f36db1e5c..ad6deeb2850ae407b8200d13daedf6b1f291f5bb 100644 (file)
@@ -44,7 +44,7 @@ __mdw_addto () {
 ## __mdw_programp NAME
 ##
 ## Does NAME exist as an executable program?
-__mdw_programp () { type >/dev/null 2>&1 "$1"; }
+__mdw_programp () { command -v "$1" >/dev/null 2>&1; }
 
 ## __mdw_setconf VAR CONF [DEFAULT]
 ##