help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: system-command-exists-p


From: Lennart Borgman
Subject: Re: system-command-exists-p
Date: Mon, 7 Dec 2009 17:30:51 +0100

On Mon, Dec 7, 2009 at 8:17 AM, Andreas Roehler
<andreas.roehler@online.de> wrote:
>
> Hi,
>
> needed a check if a command exists on system.
> Employed the following:
>
> (defun system-command-exists-p (command)
>  "Return t if COMMAND is available on system. "
>  (let* ((cmd (format "type %s" command)))
>    (eq 0 (shell-command cmd))))
>
> Any comments/suggestions?


"type" is a system specific command. It may be worth trying to use
something not system specific to avoid trouble (maybe wasting your
time and other peoples time otherwise).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]