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

${name:?word} get executed though -n specified



hey,

I just noticed that even though -n option specified for checking syntax of a script, the ${xxx:?yyy} still gets executed:

[hpt@hpt]/tmp% cat t.sh
#!/bin/zsh
a=${a:?'not set!'}

echo $a
date
[hpt@hpt]/tmp% zsh -n ./t.sh
./t.sh:2: a: 'not set!'
[hpt@hpt]/tmp%

Is this a problem?


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