Skip to content

Instantly share code, notes, and snippets.

@Matt3o12
Created August 16, 2014 18:45
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 Matt3o12/f676205da897466521e0 to your computer and use it in GitHub Desktop.
Save Matt3o12/f676205da897466521e0 to your computer and use it in GitHub Desktop.
failed=false
total=1000
for i in $(seq ${total}); do
printf "Status: ${i}/${total}\r"
psql --user "Matt3o12" --no-password --host="localhost" --port=5432 --dbname="Matt3o12" -c "" || failed=true
if [ "$failed" = true ]; then
echo "Error after attempt ${i}."
exit 1
fi
done
echo "Done..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment