The shell script was called for half an afternoon .. Shell is really a Nb tool .. Thanks for a space. If you do not enter one space, the space can be adjusted to death ..
1. There are some very strange errors. The error location during execution is not necessarily correct. In the afternoon, when the variable is initially defined, the last time I wrote less ", when the result is executed, the syntax error near unexpected token '(', which can be found through-x debugging.
2. Echo "some thing"> $ File
When the redirection symbol> is used to locate the output stream to the file, it is automatically created if the file does not exist. But !!! The premise of automatic creation is that the directory where the file is located already exists. You can only manually create the file by mkdir.
3,
Date_format = $ (echo $ SelectDate | SED's/-// G ')
This statement causes:
++ Echo 2013-08-09
++ Sed S/-// G
+ Date_format = 20130809
* *****. Sh: line 65: date_format: Command not found
Because there is a space between the equal sign and the left .. It's a tragedy .. Use date_format as a command
Do not have spaces on both sides of the equal sign.
4. When using MySQL commands
-Add the double quotation mark "" to the statement after the E Parameter