#!/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 ' #
/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
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
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,
Functional Requirements:A shell script, in order to use a multi-process, to start more than 10 background running programs, in order to prevent the script than the background process prematurely end caused unpredictable impact, now to determine
Reference:Http://bbs.chinaunix.net/thread-1633281-1-1.htmlDemand:The "/data/cache" string is sufficient in the cache_dir of the judging variableAct 1:if [["${cache_dir}" =~ "/data/cache"]; Then echo "true" fiAct 2:if [[${cache_dir} = */data/cache*]];
In the shell, you can run the script in 3 ways:1. ./script_name or source./script_name2 Direct./script_name3./script_name &Join script Script_name There are two command command1,command2, then, when run in the first way, Command1 and Command2 both
Type [-AFTPP] name [name,...]-A prints all possible cases of name, such as Type-a ls, which will print LS is aliased to ' ls--color=auto ' and LS is/bin/ls-F does not go to find function-T Print alias,keyword,function,built-in,file these 5 types-P
I took over two projects, suddenly the eldest brother asked me what configuration of the server, then I was ignorant, has not been too concerned about this thing, just to ensure that the server normal operation, the site can access normal, the other
In the shell, a command is written in 3:1 can write directly (Normal Command)2 can be placed in double quotation marks ("Command")3 can be placed in single quotes (' Comand ')In this 3, the execution flow of the command is not the same, as shown
The shell condition test can be done in two ways:Test parameters Testing Content[Parameter test content]First, test file type:TEST-E file name (test file exists)[-e FileName] Test file exists, note the space on both sides of the bracketTest-f file
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service