zsh-users
 help / color / mirror / code / Atom feed
* Arithmetic Zero
@ 2024-03-05  3:28 sergio
  2024-03-05  4:23 ` Bart Schaefer
  2024-03-05  7:26 ` Roman Perepelitsa
  0 siblings, 2 replies; 5+ messages in thread
From: sergio @ 2024-03-05  3:28 UTC (permalink / raw)
  To: zsh-users


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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-05  7:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-05  3:28 Arithmetic Zero sergio
2024-03-05  4:23 ` Bart Schaefer
2024-03-05  5:02   ` Lawrence Velázquez
2024-03-05  7:09   ` Stephane Chazelas
2024-03-05  7:26 ` Roman Perepelitsa

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).