Public bug reported:
Hello,
I worked on a script who generate mac address randomly and I remark the
$RANDOM variable is empty when I launch the script with sudo.
For example :
########################
#/bin/bash
#Test random
echo "\$RANDOM Test"
echo
echo "\$RANDOM = $RANDOM"
echo
echo
#######################
In terminal :
[EMAIL PROTECTED]:~/prog$ ./random
$RANDOM Test
$RANDOM = 5625
[EMAIL PROTECTED]:~/prog$ sudo ./random
$RANDOM Test
$RANDOM =
[EMAIL PROTECTED]:~/prog$ sudo -s
[EMAIL PROTECTED]:~/prog# ./random
$RANDOM Test
$RANDOM = 25614
[EMAIL PROTECTED]:~/prog# exit
exit
[EMAIL PROTECTED]:~/prog$ sudo -s ./random
$RANDOM Test
$RANDOM = 31066
It's ok only if you use the -s option.
I tested on Debian Lenny, the bug is not here.
** Affects: sudo (Ubuntu)
Importance: Undecided
Status: Invalid
--
$RANDOM is empty in a script launched with sudo
https://bugs.launchpad.net/bugs/297282
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs