Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql:/home/rob/cli-scripts# ./myloop -d nowcom_nl -e "SELECT COUNT(*) AS rows FROM %q"
- + usage='Usage: ./myloop [-h] [-v] [-a] [-o] [-d database] [-t table] [-e statement]'
- + read -p 'Enter username: ' username
- Enter username: root
- + read -p 'Enter password: ' -s password
- Enter password: + exclude_databases=(information_schema mysql)
- + getopts hvaod:t:e: opt
- + case "$opt" in
- + declare -r do_database=nowcom_nl
- + getopts hvaod:t:e: opt
- + case "$opt" in
- + declare -r 'stmt_db=SELECT COUNT(*) AS rows FROM %q'
- + getopts hvaod:t:e: opt
- + IFS='
- '
- + read -a databases
- ++ mysql -uroot -pstring -s --skip-column-names -e 'SHOW DATABASES'
- + for database in '"${databases[@]}"'
- + isIn information_schema information_schema mysql
- + local pattern=information_schema element
- + shift
- + for element in '"$@"'
- + [[ information_schema = information_schema ]]
- + return 0
- mysql:/home/rob/cli-scripts#
- mysql:/home/rob/cli-scripts# ./myloop -d nowcom_nl -e "SELECT COUNT(*) AS rows FROM %q"
- + usage='Usage: ./myloop [-h] [-v] [-a] [-o] [-d database] [-t table] [-e statement]'
- + read -p 'Enter username: ' username
- Enter username: root
- + read -p 'Enter password: ' -s password
- Enter password: + exclude_databases=(information_schema mysql)
- + getopts hvaod:t:e: opt
- + case "$opt" in
- + declare -r do_database=nowcom_nl
- + getopts hvaod:t:e: opt
- + case "$opt" in
- + declare -r 'stmt_db=SELECT COUNT(*) AS rows FROM %q'
- + getopts hvaod:t:e: opt
- + IFS='
- '
- + read -a databases
- ++ mysql -uroot -pstring -s --skip-column-names -e 'SHOW DATABASES'
- + for database in '"${databases[@]}"'
- + isIn information_schema information_schema mysql
- + local pattern=information_schema element
- + shift
- + for element in '"$@"'
- + [[ information_schema = information_schema ]]
- + echo 0
- 0
- + for element in '"$@"'
- + [[ mysql = information_schema ]]
- + echo 1
- 1
- mysql:/home/rob/cli-scripts#
Add Comment
Please, Sign In to add comment