Linux/unix passing variables between shell SQL

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

Shell regularly backs up database information

#!/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 ' #

Shell script, how to monitor the contents of the file under the directory is modified.

md5

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*.

Learn the shell happily

/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

Bash Shell Utility shortcut keys

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

There are four ways in which the Bash Shell's arithmetic operations

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1: Using expr external programAddition R= ' Expr 4 + 5 'Echo $rAttention! ' 4 ' + ' 5 ' There should be a gap between the threeR= ' Expr 4 * 5 ' #错误Multiplication r= ' expr 4 \* 5 '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~2:

(vi) write a first shell

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

Linux shell switching

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]:/

Bash Shell common shortcut keys

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

Use of shell variables

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,

Implementation of shell Multi-process

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 operation

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

Shell 2 Tetris

      declare -i noar= (1 1 1 1); Br= (1 1 1  1 1 1 1 1 1 1    1 0 0 0 0 0  0 0 0 1    1 0 0 0 0 0 0 0 0  1    1 2 0 0 0 0 0 0 0 1     1 0 3 0 0 0 0 0 0 1    1 0  0 4 4 5 0 0 0 1    1 0 0 0 0  0 0 0 0 1    1 1 1 1 1 1 1 1  1 1) echo  "[][]|" echo  " 

Shell Learning notes-the first day

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

Shell script exercises Basic Article 2

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"            

Progress bar---shell script implementation

1. Procedure650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/85/99/wKiom1epjIzSGVmbAABUg44vkDo770.png-wh_500x0-wm_3 -wmp_4-s_3200651285.png "style=" Float:none; "title=" Captures 1. PNG "alt=" Wkiom1epjizsgvmbaabug44vkdo770.png-wh_50 "/>2.

Shell loops, simple little exercises

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="

Hadoop HDFs Shell

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,

Bash Shell Basics

Bash a few common code######## #最简单的bash#! /bin/bash #解析器路径 env #查看环境######### #看运行时间#!/bin/time. SH start=$ (date +%s) #commands; #statements; Sleep Ten ; #command End=$ (date +%s) Difference=$ ((End-

Simple application of shell arrays

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]}".

Total Pages: 541 1 .... 530 531 532 533 534 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.