Skip to content

Instantly share code, notes, and snippets.

@lyuehh
Created November 18, 2013 15:35
Show Gist options
  • Save lyuehh/7529798 to your computer and use it in GitHub Desktop.
Save lyuehh/7529798 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ $# -ne 3 ];
then
echo "need 3 args.."
exit 1
fi
for((i=0;i<$1;i++))
do
sleep $2
$3
echo
done
@lyuehh
Copy link
Author

lyuehh commented Dec 4, 2013

#!/bin/sh

if [ $# -ne  3 ];
then
    echo "Usage: rept repeat_times sleep_seconds commands"
    exit 1
fi

for((i=0;i<$1;i++))
do
    sleep $2
    eval $3
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment