Note: After the awk command, there are not too many complex commands, which are basic commands.
Description
Cat, which is the abbreviation of the word concatenate, outputs the contents of the file to stdout. When the redirection operator (> orWhen
An array is a set of elements of the same data type arranged in a certain order, that is, a variable of the same type is named with a name and then numbered to distinguish their set of variables, which is called an array name, and the number is
Objectivetoday I just wrote an automated packaging script, again using the bash shell, a good feeling of happiness. The main point here is to introduce the Select command, which can help us complete the menu selection function.
FormatI am also the
Function Description: Tell the shell to remove the eval parameters, recalculate the contents of the parameters.Syntax: eval [parameters]Supplemental Note: Eval can read a series of parameters and then perform them according to the characteristics of
1. Methods of primitive violence
Copy Code code as follows:
mylinux:/home/zhanhailiang/public_html # Killall Nginx
2, gentle point of approachFinds the PID for the specified process and kill|kill-usr1 it off
Copy Code code as
The first description of our configuration file, are similar format, if the intranet is 192.168.0.3, the extranet is 123.123.123.123, the configuration file is as follows:
$db [' salver '] [' hostname '] = ' 192.168.0.3:3306 ';$db [' salver '] ['
Find a special embarrassing fact. I worked hard to Baidu data, want to use rewrite to achieve different domain name source station after the failure of automatic jump function, but the whole idea of missing a serious problem.
In my mind, make a
This email alert script is everywhere, a lot of use of sendmail, Postfix, feel a bit overqualified, and some use Perl net::smtp and AUTHEN::SASL module, but I use Perl is not good, The old send out some baffling mails (for example if (a>1) {print (a)
First, receive the fixed length of the parameter
Copy Code code as follows:
[Root@svn shell_example]# Cat params.sh
#!/bin/bash
#传参测试脚本
echo "My name is ' basename $ ' I ' called as $"
echo "My I-parameter is: $"
echo "My
Today there is a server A to transfer all the Web site program to another server B up, but away from work time is only 1 hours, in order to work on time, simply wrote a shell script to monitor whether there is transmission, I first in the server a
Today, my company colleagues came to me and said that I was going to execute the Python script on the server with another user, but it was always done by the root user in the crontab, so I thought of a lazy way to use the shell script to switch to
The company's recent server testing, the need to constantly adjust the system time, one or two is ok half, a little more points, on a variety of entanglements, the author of these several sets of the author is going crazy. Eldest brother: All speed
The process is written in a script, the principles are written in the comments, you understand. One-click operation is sudo bash xxx.sh
Copy Code code as follows:
#!/bin/bash
#cd到临时目录创建配置文件
Cd/tmp
(Cat
Setoutputfilter
The last time we sent a Python update Google hosts script, today saw someone sent a shell to get Google hosts script, I took to a slightly more simple processing, the following gives you the shell version of the update of Google hosts script.
1. When defining a variable, no spaces can be left on either side of the = number.eg:Gender=femal ———— RightGender =femal ——— –wronggender= femal ——— –wrong2. Conditional test statement [Both sides of the symbol must be left blank.eg:if [$gender =
This script has been used for more than a year on the production server, and this script advocates simplicity and beauty, and requires only one script to automatically configure LNMP on any server that has a network.
In the script execution
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