One simple helper function you can use in your .emacs for this, could be something like:
(defun djcb-shell-command-maybe (exe &optional paramstr)
"run executable EXE with PARAMSTR, or warn if EXE's not available; eg. "
" (djcb-shell-command-maybe \"ls\" \"-l -a\")"
(if (executable-find exe)
(shell-command (concat exe " " paramstr))
(message (concat "'" exe "' not found found; please install"))))
Of course, this function is not very useful by itself, but we'll use it in later entries, and of you can use it in your own scripts.
No comments:
Post a Comment