Skip to content

Instantly share code, notes, and snippets.

@paulboardman
Created January 9, 2017 14:12
Show Gist options
  • Save paulboardman/e32addbe1715c027e8b231e28cd088ac to your computer and use it in GitHub Desktop.
Save paulboardman/e32addbe1715c027e8b231e28cd088ac to your computer and use it in GitHub Desktop.
Generate n integers selected randomly from 1 to m
#!/bin/bash -eu
n=100
m=5
for i in $(seq 1 $n); do
echo $(( (RANDOM % $m) + 1));
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment