From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: system-command-exists-p Date: Mon, 7 Dec 2009 17:30:51 +0100 Message-ID: References: <4B1CAC27.4060802@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1260208452 19234 80.91.229.12 (7 Dec 2009 17:54:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2009 17:54:12 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Andreas Roehler Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 07 18:54:04 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NHhme-0005OQ-7D for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Dec 2009 18:54:04 +0100 Original-Received: from localhost ([127.0.0.1]:41201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHhme-0003C5-0J for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Dec 2009 12:54:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHgUb-0007Uh-91 for help-gnu-emacs@gnu.org; Mon, 07 Dec 2009 11:31:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHgUU-0007Sm-Dh for help-gnu-emacs@gnu.org; Mon, 07 Dec 2009 11:31:19 -0500 Original-Received: from [199.232.76.173] (port=46807 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHgUS-0007SM-Mi for help-gnu-emacs@gnu.org; Mon, 07 Dec 2009 11:31:12 -0500 Original-Received: from mail-yx0-f191.google.com ([209.85.210.191]:61818) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHgUS-00083Y-Vz for help-gnu-emacs@gnu.org; Mon, 07 Dec 2009 11:31:13 -0500 Original-Received: by yxe29 with SMTP id 29so12433461yxe.14 for ; Mon, 07 Dec 2009 08:31:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=aNFEO7Yn1TtEtQIyJYLgvDbiAelDo8lxcYjUCvw+F08=; b=RAeSo3s/kK8wJKdHBfiQjlHObz57g8zk/1fFEjX0IZCz0nmxb8A1MpxTkd14Upmt0B 3/aAXR3ttxL89stwLOZzBRk3RSQSAUyuyEBojjJppuIRc9jXFhJ4b5tEsXC32tNlk3nX DIRWfukqUeh2AuBDqqogTOYG5r5z3mAYWJJ3s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=VzUreAJTHWZwSqGaEx7t3xZFGE9a6Bh+U4cvYBJ1gDfTToc1fHdnuvmzmJSYfhkYZh R4+4u4IOegk3WYs4LbwXCpKO1B/No5sUvwuNntuygcMvryg6vgwLQu6DhvYycC/3FsXf zkY3oliXx9RowQoYPMY8ig2TSSYqOSHN0+C5E= Original-Received: by 10.101.39.15 with SMTP id r15mr5584829anj.110.1260203471070; Mon, 07 Dec 2009 08:31:11 -0800 (PST) In-Reply-To: <4B1CAC27.4060802@online.de> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70478 Archived-At: On Mon, Dec 7, 2009 at 8:17 AM, Andreas Roehler wrote: > > Hi, > > needed a check if a command exists on system. > Employed the following: > > (defun system-command-exists-p (command) > =C2=A0"Return t if COMMAND is available on system. " > =C2=A0(let* ((cmd (format "type %s" command))) > =C2=A0 =C2=A0(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).