Flexible combination of Linux/unix shell and SQL variable transfer, greatly improve the efficiency of the DBA, this article for Linux/unix Shell SQL passed between the variables given a few simple examples for reference.Linux/unix cut with Sql,ramn
#!/bin/SH# DatabaseInfoDb_user="batsing"Db_pass="BATSINGPW"Db_host="localhost"db_name="Timepusher"# Others Varsbin_dir="/usr/bin"#the MySQL bin Pathbck_dir="/mnt/mysqlbackup"#the Backupfiledirectorydate=`Date+%F ' #
The first approach is to use CMP for comparison[Email protected] bo]#ls1. html2. html3. html4. html5. html6. html7. html8. html9. htmlCat.SH[email protected] bo]#Cat Cat.SH#!/bin/bash[! -f/root/wyb/bo/Cat. log] &&Cat*.html >/root/wyb/bo/Cat. LogCat*.
/bin/bash is the default shell for Linuxsetting, reading, and deleting variablesExample: Name=zhangsan echo $name unset nameYou can view the value of the Echo $HOME $PATH of the environment variableVariable setting, there can be no spaces on both
ctrl-d corresponds to the DEL key, which is the character at which the cursor is deleted CTRL-E equivalent to end key, moving cursor to end of bank Ctrl-k is used to delete all characters from the beginning of the cursor to the end Ctrl-l clear
1, editor, compiler, Run method (3 ways to execute the script)(1) Shell program is text format, as long as the text editor can be. But because our shell is running under a Linux system, the line break must be ' \ n ' and the line break under Windows
View System available Shell types: (typically bash shell)? ~ Chsh-l/bin/sh/bin/bash/sbin/nologin/bin/Dash/bin/zshTo modify the current shell:[[email protected] ~]# Chsh-l/bin/sh/bin/bash/sbin/nologin/bin/Dash /bin/~ for root. New Shell [/bin/bash]:/
Some of the more commonly used bash shell commands are listed below for forgetting.For detailed commands, please refer to: https://github.com/LinuxTOY/linuxtoy.org/blob/master/content/bash-shortcuts.mdView history Commands:Up and Down keysCommand
Reprint please indicate http://www.cnblogs.com/winifred-tang94/There are three types of variables in the shell environment:A, environment variables; You can refer directly to the shell script in the form of "environment variable name".b,
Requirements: Multiple scripts do not interfere with each other and run simultaneously, saving timeRookie level implementation:#!/bin/shDir= "/data/test"$dir/sbin/test1.sh >>$dir/log/test1.log 2>&1 &$dir/sbin/test2.sh >>$dir/log/test2.log 2>&1 &$dir/
Zookeeper under the shell operationEnter%zk_home%/binperform zkcli.sh [-server Ip:port] #如不指定, then connect the nativeCreate:create [-S] [-e] path data ACL #创建数据节点-----s indicates that the sequential node-e represents a temporary node, and two are
1. The first line of the program specifies the program that executes the shell #!/bin/sh #! is used to tell the system that the parameter behind it is the program used to execute the file2. Output information in the consoleecho "Hello
Practice 2, write a script/root/bin/yesorno.sh, prompt the user to enter Yes or no, and determine whether the user entered Yes or no, or other information #!/bin/bash # case $1 in yy]| [YY] [EE] [Ss]) echo "You put a $1"
1. The array is full of positive integers greater than 0, using the shell to find the maximum, minimum, and average values (2 decimal places reserved)650) this.width=650; "src="
1. View HelpHadoop fs-help 2. UploadPaths on files > such as: Hadoop fs-put test.log/3. View the contents of the filePaths on Hadoop fs-cat such as: Hadoop fs-cat/test.log4. View File listHadoop Fs-ls/5. Download the filePaths on Hadoop fs-get 6,
1. [email protected] seripts]# cat array.sh2. #!/bin/sh3. zhang= (4. wujiangping5. Shuzhaoqiang6. Renhepeng7. peijiaying8. zhangyiling9. ). for (i=0; iOne by one . Do. echo "This was num $i, then name is ${zhang[$i]}".
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.