Home » Category » Unix & Linux

Unix & Linux: Is there a way to perform a syntax check on a zsh script without actually running the script?

200| Wed, 30 Apr 2008 14:12:00 GMT| j_krugman| Comments (1)
Is there a way to perform a syntax check on a zsh script without actually running the script? Something analogous to "perl -c foo.pl"?

TIA!

Keywords & Tags: way, perform, syntax, check, zsh, script, actually, running, unix, linux

URL: http://programming.itags.org/unix-linux-programming/101797/
 
«« Prev - Next »» 1 helpful answers below.
J Krugman <jkrugman345...yahbitoo.com> wrote:
> Is there a way to perform a syntax check on a zsh script without
> actually running the script? Something analogous to "perl -c
> foo.pl"?


You could try using zcompile and throw the result away. Alternatively,
use a function definition around it to prevent it running:

eval "f() { $(<script) }"

Oliver

oliver_kiddle | Wed, 30 Apr 2008 14:13:00 GMT |

Unix & Linux Hot Answers

Unix & Linux New questions

Unix & Linux Related Categories