Skip to main content

All Questions

Tagged with
3 votes
1 answer
690 views

Different behavior of $( … $RANDOM … ) in zsh and bash functions

This: woof() {         /usr/bin/woof -p $(expr $RANDOM % 32768 + 1024) $@ } Always returns same number for parametr -p on zsh. In bash $(...) is evaluated on every call. Replacing $( ... ) with $[ .....
korda's user avatar
  • 178