The sh(1) manage does not mention the RANDOM variable.

However the following script seems to work:

```
#!/bin/sh
echo $RANDOM
```

(Same as `$ sh -c 'echo $RANDOM'`.)

OTOH using RANDOM in a crontab(5), which has the SHELL=/bin/sh line, does not 
seem to work.

sh(1) does mention that it is based on ksh and ksh(1) does mention the RANDOM 
variable.


So is RANDOM supposed to work in sh(1)?

If so, why isn’t this documented?

If not, why does the above script work?


Thanks!
Mike

PS. OpenBSD 7.7-stable amd64 and 7.7-current arm64

Reply via email to