From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26906 invoked by alias); 12 Aug 2010 10:28:52 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15267 Received: (qmail 22714 invoked from network); 12 Aug 2010 10:28:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.214.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=DG5kqvSCZXLGyITUsW9T6PNofnOFsw3+LI4p8Xh0MsI=; b=Tbb9+troevz8mF8XwbOL/xHSdzacsG+iOaVJkRseRbMYWbJoIYf96iV5y66NmtbWHn +gFrxYPqBbdD7b1X3TN/dBg7YcUb1ZLplKHiQtZj+6yIOrDW2swvLo8N9gG29ylOcAez MitSjvFA0vtYsvKr5rDe38uyTVUhvBH5nXiuM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=DLdMDxRCo2XPZ32/OrYb7al4pFpHK/uEx1Q2eGavNKNHGh/WOiSc+Ofdf8olA0cTiD kJwgyf1EwrYYtrMEtqpIahIm09TdSH3NcbOU6NVT25TH/5N1R8kTj/O2aVK9vn6/Sy0X C71Eublv4hDesjyMFD6vW9bTbfhfd3LWvuEr8= MIME-Version: 1.0 From: Guillaume Brunerie Date: Thu, 12 Aug 2010 12:23:00 +0200 Message-ID: Subject: Zsh option for checking if a file is a shell script To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=0016364991650eac0a048d9dc16b --0016364991650eac0a048d9dc16b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, Is there some option (for example --check-syntax) such that $ zsh --check-syntax /path/to/a/shell/script doesn=E2=80=99t do anything except that the return code would be 0 if /path/to/a/shell/script is indeed a shell script, and non zero otherwise= ? (in particular I don=E2=80=99t want to execute the shell script at all) I want to know if a given file is a shell script or not, and I cannot use the extension or the shebang because some files (e.g. /etc/zprofile) doesn= =E2=80=99t have any of them. Thank you. Guillaume Brunerie --0016364991650eac0a048d9dc16b--