Shell script to traverse folders and deploy sql files
1 Attachment(s)
I need to write a bash script which can traverse directories and sub-directories and deploy SQL files to MySQL database. I have written script (attached as script.sh) which is giving error "ERROR: Can't initialize batch_readline - may be the input source is a directory or a block device.". Please let me know how to avoid this error and deploy only *.SQL files.
|
Quote:
https://www.linuxquestions.org/quest...-files-879692/ As before, have you done ANY debugging on your script? The bash scripting beginners guide has steps on how to debug bash shell scripts: http://tldp.org/LDP/Bash-Beginners-G...ect_02_03.html Start there. |
also you may try to insert set -xv at the beginning of your script to see what's happening
|
this line is fubar:
Code:
/usr/bin/mysql --login-path=local --comments TestDB -f < $filename || exit 0; |
All times are GMT -5. The time now is 07:10 AM. |