Created
June 24, 2010 06:56
-
-
Save ikcaro/451091 to your computer and use it in GitHub Desktop.
Como generar números aleatorios desde la consola
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#numero aleatorio | |
echo $RANDOM | |
#numero aleatorio [1-15] | |
echo $[ ($RANDOM % 15) + 1 ] | |
#numero aleatorio [15 - 25] | |
echo $[ ($RANDOM % 10) + 15 ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Como generar números aleatorios desde la consola (fuente: http://gnuowned.tumblr.com/post/729749919/como-obtener-numeros-aleatorios-desde-la-shell)