From 9cb4840fca3d72201e9e96cc12bb0cadfe8c133b Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Fri, 3 Jan 2014 19:05:45 +0100 Subject: [PATCH] Emacs shell snippet: notcmd --- .emacs.d/snippets/sh-mode/notcmd | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .emacs.d/snippets/sh-mode/notcmd diff --git a/.emacs.d/snippets/sh-mode/notcmd b/.emacs.d/snippets/sh-mode/notcmd new file mode 100644 index 00000000..475091b5 --- /dev/null +++ b/.emacs.d/snippets/sh-mode/notcmd @@ -0,0 +1,7 @@ +# name: ! command ... +# key: notcmd +# -- +if ! command -v $1 >/dev/null 2>&1; then + echo >&2 "'$1' not found in PATH. Exiting." + exit 1 +fi