Because the individual station can not guarantee higher availability, there may be data easy problems, so it is necessary to achieve backup database needs, so I found some information on the Internet, combined with my actual situation, through the
1.10 Get, set date and time delay
Many applications need to print the date in different formats, set the date and time, and perform an action based on the date and time. Latency is typically used to provide a wait time (for example, 1
1.5 using the shell for mathematical operationsIn any programming language, arithmetic operations are essential, and the shell is no exception.1.5.1 arithmetic operations using Let, (()), and []
You can use the normal variable assignment
1.7 arrays and associative arrays
An array is a very important part of Shell scripting, and it uses indexes to store multiple independent independent data as a collection. An ordinary array can use integers only as an array index, and
1.3 Playing variables and environment variablesvariables are an essential part of any programming language and are used to store variables of various types. Scripting languages are mostly weak type languages (dynamic languages), meaning that when
Citation: in today's era, email has become an important means of communication. e-mails to mentors, communication between academic studies, etc. Email is often used, but the verification of email is a little difficult, and here is an example of
Test command usage:1) Judgment expressionif test (expression is true)if test! An expression is falsetest expression 1–a expression 22 expressions are truetest expression 1–o expression 22 expressions have a true2) Judging the stringtest–n String
This article will explain some of the commands used in Linux and tips to help beginnersAn e v A l command will first scan the command line for all permutations before executing the command. This command applies to variables that scan for a time that
The ~/.SSH directory already exists on the default remote host. Execute the following script on your PC, enter the server user name and IP address, and log in without password the next time you log in.#!/bin/bashid_res_pub=~/.ssh/id_rsa.pubif [!-F "$
1.2 Terminal printing
A terminal is an interactive tool that allows users to interact with the shell environment. Printing text in a terminal is a basic task that most shell scripts and tools need to perform daily. Through the terminal
Using the Unix/linux system UUID file to intercept the partial generation of random numbers, and in order to prevent the renaming process may already exist and the new random directory with the same name of a sub-directory, that is, the renaming
The shell has conditional test statements, which are usually done using the test command or the [] command, which is the basis of the conditional Judgment statement If~then statement, especially the [] command. Let's explain some of the conditional
Basic arithmetic operations, as well as bitwise operations, can also be implemented in the shell.We have summed up the following points:1) Basic arithmetic operators: + 、-、 *,/, * * are supported, the last * * is a power operation;2) arithmetic
There are several ways to execute the shell script1, relative path mode, you need to first CD to the script path[[email protected] tmp]# Cd/tmp[[email protected] tmp]#./ceshi.sh Script Execution succeeded2. Absolute path mode[[email protected] tmp]#/
SHELL programmingDirectory:1.shell Brief Introduction2.shell Programming Preparation3.shell Programming Structured Language Building4. OtherTwo examples of 5.shell programmingWrite in front:1.Hello World#! /bin/bash# This is aexample of bash
4. Input and output#! /bin/bash# Read users input and then get his nameread"Please input your first name: " firstNameread"Please input your last name: " lastNameecho-e"Your full name is: $firstName $lastName"Read usage:read[-ers][-a 数组][-d
Transfer from http://blog.chinaunix.net/uid-21961753-id-1810588.htmlformat: Test conditionstest-n string:string not emptytest-z string:string is emptyTest Int1-eq int2:int1 = = int 2Test Int1-ne int2:int1! = Int2test int1-gt int2:int1 > Int2test Int1
Variable Description:$$ The shell itself PID (ProcessID)$! PID of the Shell's last running background process$? End code of last Run command (return value)$-flag at a glance using the SET command$* all parameter lists. such as "$*" in the Case of ""
Here is an example of a simple tag, throw this question, and then add the complete.The parsing order of bashExample:[Email protected]:~/sh_test$ sudo awk ' nr==1 {print $} '/etc/shadowRoot:!:16141:0:99999:7:::[Email protected]:~/sh_test$ sudo awk '
idea, produce a random array, and then press the elements of the array to re-output the rows in the file 1, the generation of random array reading when it feels very simple. The first time with a little bit. The first is the definition,
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.