bsautner
August 10th, 2011, 06:30 PM
This is really weird and probably has a simple fix but check this out - driving me crazy
Ubuntu 11.04 in a terminal i type
$echo $RANDOM
I get a random number as expected.
I create a bash script ($vi script.sh):
#!/bin/bash
echo $RANDOM
do a chmod a+x on it
run sh ./script.sh
and i get en empty response - i.e as if $RANDOM returned a null or empty string or something. In any case where i use $RANDOM in a bash script it returns empty but it works on the command line... thoughts!? I'm missing something here.
Ubuntu 11.04 in a terminal i type
$echo $RANDOM
I get a random number as expected.
I create a bash script ($vi script.sh):
#!/bin/bash
echo $RANDOM
do a chmod a+x on it
run sh ./script.sh
and i get en empty response - i.e as if $RANDOM returned a null or empty string or something. In any case where i use $RANDOM in a bash script it returns empty but it works on the command line... thoughts!? I'm missing something here.