#!/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 ' #
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
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
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/
What to learn in this chapter---------- Function Introduction---------- function Definition---------- function uses---------- differentiate return and the Exit---------- Delete a function---------- Precautions1. Introduction function When you
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
Eval syntaxEval arg1 arg2 ...The function of Eval is to take the following parameters Arg1 Arg2 and so on as a pipeline, and then re-execute the shell process pipeline (about pipeline, see http://www.cnblogs.com/chaoguo1234 /p/5724321.html)Suppose
First, Shell special variables1. Position Variables
Positional variables
Meaning
$
Gets the file name of the currently executing shell script, including the script path
$n
Gets the nth
What I'm sharing for you is how to use case statements to write some scripts that you choose to execute. Case statements are mainly adapted for use in some complex selection of scripts, if we use if multi-branch statements can also be written out,
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
One, bash variables:Variable naming laws:1. The reserved words in the program cannot be made: for example if, for;2, only use numbers, letters and underscores, and cannot start with a number3. See the meaning of the name4, the Uniform naming rule:
How to handle the programming logic:1, sequential execution2, select Execute3, loop executionConditional Select if statementSelect Execute:Note: If statements can be nestedSingle Branchif judgment condition; thenBranch code with true
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"
First, the concept and characteristics of regular expressions:A regular expression is a logical formula for a string operation, which is to make a "rule string" with a predefined set of characters and a combination of those specific characters.This "
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,
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*]];
Test instructionsGive a continuous coloring method of 1-n beads A[i] (1Analysis:The DP equation can be obtained: Dp[n] =∑ (i=1,n) (Dp[n-i]*a[i]).The equation is convolution form, so CDQ + FFT CDQ: Will [L,r] two points, first get [L,mid] answer,
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