Skip to content

Instantly share code, notes, and snippets.

@cjus
Created December 23, 2011 00:04
Show Gist options
  • Save cjus/1512408 to your computer and use it in GitHub Desktop.
Save cjus/1512408 to your computer and use it in GitHub Desktop.
Random numbers in shell scripts
#!/bin/bash
productID[1]=12894ecabe3d01eae4a4dfab8fbfc3a5
productID[2]=4a4f5c9f1347c11080adcd09bd0230e8
productID[3]=4a4f5c9f1347c11080adcd09bd023452
RANDOM=`date '+%s'`
echo ${productID[$[($RANDOM % 2) + 1]]}
echo ${productID[$[($RANDOM % 2) + 1]]}
echo ${productID[$[($RANDOM % 2) + 1]]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment