Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Zsh option for checking if a file is a shell script



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


Messages sorted by: Reverse Date, Date, Thread, Author