After testing, the script does not set up!!
The site uses a number of methods to accelerate (REDIS\CDN), this reduces user access to back-end MySQL pressure, as well as the front-end speed is not very good problem, the user requested to all the
Suppose we are confronted with a problem like this, the company's key data copy to the test server, after it is deleted directly, still worry that the server vendor can restore it, even through Fdisk reformatting, there is still the risk of recovery,
Two very detailed shell instances
General programming steps
Now let's discuss the general steps to write a script. Any good script should have help and input parameters. and write a pseudo script (framework.sh) that contains the framework structure
First, compression and decompression
1, compress [-RCV] file or directory
uncompress files. Z
-R: Can be compressed together with the files in the directory
-C: Export compressed data to standard output (output to screen)
-V: Can display the
Requirements Analysis:
1, SSH Public key copy, provide no password management.
2, batch synchronization hosts files to more than one host.
3. Batch modification of host name.
Realize:
First edit a Hosts file for synchronization to multiple
Objective
Now every time you analyze the site log, you need to judge Baidu Spider is not the real spider, nslookup after the need to determine whether the results include "Baidu" string
Here are some of the methods that are included in the
Today's case is the decision to input to the user
#!/bin/sh # validint-validates integer input, allowing negative ints. function Validint {# Validate field. Then Test against Min value $ and/or # max value $ if they are supplied.
If They
Today is about deciding whether the date entered is correct, and using the function in the example 03 before us is code
#!/bin/sh # valid-date-Validates a date, taking into account leap year rules. Exceedsdaysinmonth () {Case $ (echo $1|tr '
According to the smart principle I set goals for 2016 years. Each month has a small goal, each of which is specific (specific), measurable (measurable), attainable (achievable), relevant (relevance), Time-bound (time limit). The January goal was to
In general, use the "Telnet IP port" to determine the port pass, in fact, testing methods more than this one, there are many ways, the following small series to share several methods, the specific content please look down:
Preparing the Environment
One, single branch if statement
Format: if judge condition; then
Statement1
statement2 ...
Fi
Two, two-branched if statement
Format: if judgment condition; Then
Statement1
statement2 ...
else
statementn
...
Fi
Use a
For example, after more than one system, application installation, we often need to modify a lot of configuration files, with the VI editor means time-consuming, repetitive work, and SED can release us from the heavy duplication of work.
How SED is
Using shell script to automate the maintenance of the system is simple, convenient and portable.
But shell scripts are readable and writable, and are likely to reveal sensitive information, such as user name, password, path, IP, and so on.
Ctrl + a switches to command line start
Ctrl + e Switch to the end of the command line
Ctrl + L Clear Screen contents
Ctrl + U Clear the contents before the clipping cursor
Ctrl + K-cut to clear the contents after the cursor
Ctrl + y Copy the
The 2nd generation Linux operating system in the installation of software is quite simple: the first step, search for the software you want, such as you want to find a game software, its name is called Myward, the Game Software description is: Myown
Download a single file and print the output to standard output (STDOUT) by default
Curl http://www.centos.org
Save the downloaded file to the specified file by using the-o/-o option:
-O: Save the file as a file name specified in the
1. Create the executable file t2.sh and print "Hello world!"[Email protected] ~~ $ cd tscripts/'#!/bin/bash' >>' echo "Hello world!" ' >>~/tscripts $ chmod +x *~/tscripts $./t2.sh Helloworld!2. Methods to run the executable file in 3[Email
Shell echo CommandDisplay Normal string:echo "I am cat_crazy."Note: The double quotes here can be omittedShow escape characters:If you want to output quotes, the * number needs to be escaped to output, as followsecho \ "I am cat_crazy\"The output is
1. Document CollationWork number and name are recorded in the employee fileEmployee.txt:Jason SmithJohn DoeSanjay GuptaAshok SharmaRecord work number and salary in bonus fileBonus.txt:100 $5,000200300 $3,000400 $1,250Requires merging two files and
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