Skip to content

Instantly share code, notes, and snippets.

@ik5
Last active December 21, 2015 01:38
Show Gist options
  • Save ik5/6228856 to your computer and use it in GitHub Desktop.
Save ik5/6228856 to your computer and use it in GitHub Desktop.
random execution in given time
#!/bin/bash
seq=$(seq -s ' ' $[ $RANDOM % 8 +1 ] )
hour=($(shuf --input-range=0-23 -n 8 | tr '\n' ' '))
minutes=($(shuf --input-range=0-59 -n 8 | tr '\n' ' '))
for i in $seq ; do
atime=${hour[$i - 1]}${minutes[$i - 1]}
$(at $atime <<< /usr/bin/runsomething)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment