Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Arithmetic Zero
- X-seq: zsh-users 29715
- From: sergio <sergio@xxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Arithmetic Zero
- Date: Tue, 5 Mar 2024 06:28:04 +0300
- Archived-at: <https://zsh.org/users/29715>
- List-id: <zsh-users.zsh.org>
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