Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # !/bin/bash
- if [ -z "$3" ]; then
- echo "Usage: $0 <task-id> <exec-time-in-seconds>"
- exit 1
- fi
- echo "Task $1 starting, execution time is $2, will-fail is $3"
- for i in `seq 1 $2`; do
- echo "Task $1 tick - $i"
- sleep 1
- done
- if [ "$3" == "1" ]; then
- # Write to stderr and exit
- echo "** ERROR ** Task $1 failed! exiting with error." 1>&2
- exit 1
- fi
- echo "Task $1 done, exiting with success."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement