Skip to content

Instantly share code, notes, and snippets.

@nikuuchi
Created December 9, 2011 05:13
Show Gist options
  • Select an option

  • Save nikuuchi/1450281 to your computer and use it in GitHub Desktop.

Select an option

Save nikuuchi/1450281 to your computer and use it in GitHub Desktop.
100個の8桁以下のランダムな整数を出力する。あんまりうまくない作りなので、もう少し良いものが必要になったら作る。
#!/usr/bin/env bash
for i in {0..99};\
do \
num=`expr $i % 8 + 1`\
cat /dev/urandom | tr -c -d "[:digit:]" | head -c $num |sed -e 's/^00*/1/g';\
echo '';\
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment