Guest User

Untitled

a guest
Jun 3rd, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. mysql:/home/rob/cli-scripts# ./myloop -d nowcom_nl -e "SELECT COUNT(*) AS rows FROM %q"
  2. + usage='Usage: ./myloop [-h] [-v] [-a] [-o] [-d database] [-t table] [-e statement]'
  3. + read -p 'Enter username: ' username
  4. Enter username: root
  5. + read -p 'Enter password: ' -s password
  6. Enter password: + exclude_databases=(information_schema mysql)
  7. + getopts hvaod:t:e: opt
  8. + case "$opt" in
  9. + declare -r do_database=nowcom_nl
  10. + getopts hvaod:t:e: opt
  11. + case "$opt" in
  12. + declare -r 'stmt_db=SELECT COUNT(*) AS rows FROM %q'
  13. + getopts hvaod:t:e: opt
  14. + IFS='
  15. '
  16. + read -a databases
  17. ++ mysql -uroot -pstring -s --skip-column-names -e 'SHOW DATABASES'
  18. + for database in '"${databases[@]}"'
  19. + isIn information_schema information_schema mysql
  20. + local pattern=information_schema element
  21. + shift
  22. + for element in '"$@"'
  23. + [[ information_schema = information_schema ]]
  24. + return 0
  25. mysql:/home/rob/cli-scripts#
  26.  
  27. mysql:/home/rob/cli-scripts# ./myloop -d nowcom_nl -e "SELECT COUNT(*) AS rows FROM %q"
  28. + usage='Usage: ./myloop [-h] [-v] [-a] [-o] [-d database] [-t table] [-e statement]'
  29. + read -p 'Enter username: ' username
  30. Enter username: root
  31. + read -p 'Enter password: ' -s password
  32. Enter password: + exclude_databases=(information_schema mysql)
  33. + getopts hvaod:t:e: opt
  34. + case "$opt" in
  35. + declare -r do_database=nowcom_nl
  36. + getopts hvaod:t:e: opt
  37. + case "$opt" in
  38. + declare -r 'stmt_db=SELECT COUNT(*) AS rows FROM %q'
  39. + getopts hvaod:t:e: opt
  40. + IFS='
  41. '
  42. + read -a databases
  43. ++ mysql -uroot -pstring -s --skip-column-names -e 'SHOW DATABASES'
  44. + for database in '"${databases[@]}"'
  45. + isIn information_schema information_schema mysql
  46. + local pattern=information_schema element
  47. + shift
  48. + for element in '"$@"'
  49. + [[ information_schema = information_schema ]]
  50. + echo 0
  51. 0
  52. + for element in '"$@"'
  53. + [[ mysql = information_schema ]]
  54. + echo 1
  55. 1
  56. mysql:/home/rob/cli-scripts#
Add Comment
Please, Sign In to add comment