examplescripts/Example8: Use 'command -v' builtin instead of 'which'.

git-svn-id: http://svn.code.sf.net/p/smartmontools/code/trunk@5404 4ea69e1a-61f1-4043-bf83-b5c94c648137
pull/151/head
chrfranke 2 months ago
parent 476ec9db47
commit b03f1a3a02
  1. 2
      smartmontools/ChangeLog
  2. 5
      smartmontools/examplescripts/Example8

@ -2,6 +2,8 @@ $Id$
2022-08-06 Christian Franke <franke@computer.org>
examplescripts/Example8: Use 'command -v' builtin instead of 'which'.
Detect accidental use of smartd_warning script in '-M exec'.
smartd.cpp: Set SMARTD_SUBJECT to empty.
smartd_warning.sh.in, os_win32/smartd_warning.cmd: Abort if

@ -13,9 +13,10 @@
test -n "$SMARTD_ADDRESS" || exit 0
# Try mail[x]
# Note: The 'command -v' builtin requires a POSIX >= 2008 conforming shell
for mailer in \
$(which mail 2>/dev/null) \
$(which mailx 2>/dev/null) \
$(command -v mail 2>/dev/null) \
$(command -v mailx 2>/dev/null) \
/usr/bin/mail \
/usr/bin/mailx
do

Loading…
Cancel
Save