I am trying to generate a random number in Bash, but it looks like $RANDOM is always returning zero.
I am using the following code
#!/bin/sh
#!/bin/bash
testing=$((RANDOM))
echo $testing
VAR=$((RANDOM%200+100))
echo $VAR
Result :
0
100
Anybody any idea how to fix this?
Remove the
#!/bin/shline from your script.$RANDOMworks inbash, not insh.