Skip to content

Instantly share code, notes, and snippets.

@atruskie
Created February 18, 2016 05:51
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 atruskie/20c1916d8f6dfbc6419a to your computer and use it in GitHub Desktop.
Save atruskie/20c1916d8f6dfbc6419a to your computer and use it in GitHub Desktop.
Simulate a long running script without the annoyance of setting up dependencies
#!/bin/bash
ANALYSIS_LENGTH=$(shuf -i 10-1000 -n 1)
echo -e "`date -u`: Analysis will take $ANALYSIS_LENGTH seconds"
sleep $ANALYSIS_LENGTH
echo "`date -u`: timeout completed"
ANALYSIS_SUCCESS=$[$RANDOM % 2]
echo -e "`date -u`: Analysis exit code: $ANALYSIS_SUCCESS"
exit $ANALYSIS_SUCCESS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment