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

Arithmetic Zero




I believe -e is best practices for scripts, so have:

```
#!/bin/zsh -e
(( test = 0 ))
echo $test
```

and it doesn't work of course.

1. What is the reason for returning 1 when an arithmetic evaluation succeeds but is zero?

2. How to do arithmetic evaluation properly in zsh sripts? postpend with || true

--
sergio.




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