From: Lennart Borgman <lennart.borgman@gmail.com>
To: Andreas Roehler <andreas.roehler@online.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: system-command-exists-p
Date: Mon, 7 Dec 2009 17:30:51 +0100 [thread overview]
Message-ID: <e01d8a50912070830ma59f1d4hba9682bc59ebf6c6@mail.gmail.com> (raw)
In-Reply-To: <4B1CAC27.4060802@online.de>
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).
next prev parent reply other threads:[~2009-12-07 16:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-07 7:17 system-command-exists-p Andreas Roehler
2009-12-07 16:30 ` Lennart Borgman [this message]
[not found] <mailman.12411.1260170302.2239.help-gnu-emacs@gnu.org>
2009-12-07 10:13 ` system-command-exists-p Pascal J. Bourguignon
2009-12-07 12:02 ` system-command-exists-p Andreas Röhler
[not found] ` <mailman.12419.1260187409.2239.help-gnu-emacs@gnu.org>
2009-12-07 13:44 ` system-command-exists-p Pascal J. Bourguignon
2009-12-07 16:22 ` system-command-exists-p Andreas Politz
2009-12-07 16:00 ` system-command-exists-p Stefan Monnier
2009-12-07 18:57 ` system-command-exists-p Andreas Röhler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e01d8a50912070830ma59f1d4hba9682bc59ebf6c6@mail.gmail.com \
--to=lennart.borgman@gmail.com \
--cc=andreas.roehler@online.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.