Skip to content

Instantly share code, notes, and snippets.

@chuckwagoncomputing
Created November 29, 2012 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuckwagoncomputing/4172688 to your computer and use it in GitHub Desktop.
Save chuckwagoncomputing/4172688 to your computer and use it in GitHub Desktop.
Random Program opener shell script
#!/bin/bash
LINES=`cat $1 | wc -l`
LINESB=`echo $((RANDOM % LINES))`
WHICH=`echo $((LINESB + 1))`
COM=`cat $1 | head -n $WHICH | tail -n 1`
eval $COM
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment