Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Zsh option for checking if a file is a shell script
- X-seq: zsh-users 15276
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Zsh option for checking if a file is a shell script
- Date: Thu, 12 Aug 2010 09:12:09 -0700
- In-reply-to: <AANLkTinuOXQNHbiPcriXRcHfs_c3rX=QCF2kwZu9DOtq@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AANLkTinuOXQNHbiPcriXRcHfs_c3rX=QCF2kwZu9DOtq@xxxxxxxxxxxxxx>
On Aug 12, 12:23pm, Guillaume Brunerie wrote:
}
} 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?
$ zsh -n /path/to/some/file
or equivalently but more obviously
$ zsh -o no_exec /path/to/some/file
will parse but not execute the file, and exit with failure if there is
a parse error. However, just because a file doesn't cause a parse error
is not a guarantee that it is a shell script, and parsing a very big
file is potentially expensive.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author