From: Guillaume Brunerie <guillaume.brunerie@gmail.com>
To: zsh-users@zsh.org
Subject: Zsh option for checking if a file is a shell script
Date: Thu, 12 Aug 2010 12:23:00 +0200 [thread overview]
Message-ID: <AANLkTinuOXQNHbiPcriXRcHfs_c3rX=QCF2kwZu9DOtq@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 529 bytes --]
Hi,
Is there some option (for example --check-syntax) such that
$ zsh --check-syntax /path/to/a/shell/script
doesn’t 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’t 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’t
have any of them.
Thank you.
Guillaume Brunerie
next reply other threads:[~2010-08-12 10:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-12 10:23 Guillaume Brunerie [this message]
2010-08-12 16:12 ` Bart Schaefer
2010-08-16 20:52 ` Guillaume Brunerie
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='AANLkTinuOXQNHbiPcriXRcHfs_c3rX=QCF2kwZu9DOtq@mail.gmail.com' \
--to=guillaume.brunerie@gmail.com \
--cc=zsh-users@zsh.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 public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).