Shell script batch table creation 1. I often use shell scripts to batch create tables, count .... whiledo [sqlstat] done, etc. during createtableselect * fromxxxxwhere12, do you have the id not automatically set up pri... shell script batch table creation 1. I often use shell scripts to batch create tables, count .... while do [SQL stat] done and so on, when create table select * from xxxx where 1 = 2, have you been attacked by the primary key index of primary key auto_increment that your id has not automatically created. 2. have you ever written function (){...} I have received parameters in the function. Have you ever written $ data = "xxx"? but in the result, you want your function to receive a parameter, but you passed the parameter fun $ data =_^. haha, in fact, the effect is like this. fun xxx, haha, I just tried it. so, you should write fun "$ data" 3. for file in 'ls | grep ^ this '. you must have used it. do you want to cd it to a directory before this command, so, when you echo $ file, will it bring the directory information? are you sure you want to say that? I got stuck. this is my code. [Plain] function load_game_data2_dbs () {file = $1 echo_log "$ file importing database ".....} [Plain] for file in 'ls | grep ^ attemp 'do echo_log "has entered the final loop, prepare to export the package "# distribute the file to the raw data on the four databases, on behalf of the auto table load_game_data2_dbs "$ Directory/$ file" echo_log ", The Data $ Directory/$ file has been imported into four databases, prepare the file to complete the initial state \ n "# import the package completion mark position on the four databases to the initial state ...... In [plain] load_game_data2_dbs, done prints $ Directory/$ file. Then, echo_log also prints $ Directory/$ file. guess what the two outputs are? I got pitted, but later I learned how to get pitted. in the load_game_data2_dbs function, you need to add the loacl keyword to the file variable. this is completely different from other languages you have learned.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service