new to shell programming
Hi, Friends
I am a newbie for the shell programming world. I can use bash to deal with files I needed, then I need to communicate with database (MySql) based on those files in order to store some information about those files. How can I achieve this? Do I need to use other scripting language such as perl, python, or ruby etc. And how to do this in shell. Some example code will be appreciated! Thanks for your help! |
Look into the "mysql" command:
Code:
man mysql |
To saman007uk
Hi, saman007uk
Thank you for your response. Running MySql under shell is an interactive mode. I am wondering in my shell script after dealing with files, then connetc to the database and do something related to the files. How can I do this? Thanks |
You can generate all the SQL code in one go, put it in a file and then run as follows:
Code:
mysql databse-name << file-containg-sql-code.sql |
All times are GMT -5. The time now is 02:44 PM. |