Skip to content

Instantly share code, notes, and snippets.

@ReticentIris
Created September 21, 2016 04:01
Show Gist options
  • Save ReticentIris/fd73cff4d11e2a3a14a6936408f8392b to your computer and use it in GitHub Desktop.
Save ReticentIris/fd73cff4d11e2a3a14a6936408f8392b to your computer and use it in GitHub Desktop.
#!/bin/sh
export MYSQL_PWD=student
if [ "$#" -eq 2 ]; then
mysql -h $AWS1 -u student -A -t -e "use $1; $2";
elif [ "$#" -lt 2]; then
mysql -h $AWS1 -u student -A -t $1;
else
echo "Invalid number of arguments."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment