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
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
Copy Code code as follows:
#!/bin/bash
#telno for the query number list file
#sendsms. Log send result file for SMS
#1 Rep sent successfully
Query_sms ()
{
>submit_telno
>delivered_telno
>fail_delivered_telno
Cat Telno |while Read line
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
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)
Randomly generated 10 8-bit password shell scripts1. First Capital Letter2. Middle six-digit alphanumeric random mixing3. Eighth place [0-9]
#!/bin.bash for
i in {1..10}
do
a= ' head-c 500/dev/urandom | tr-dc a-za-z | tr [A-z] [a-z]|head-c 1
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 =
The general shell script debugging is basically echo to deal with the larger script when, it is more trouble, out of the question, is not very good to locate which line of code problems.In fact, some of the variables built into the shell can be a
Using the shell to test the download under Linux, the code is as follows:
Copy Code code as follows:
#!/bin/bash
#date: 20140210
#used for test server download speed
R_host= "188.18.28.19"
R_dir= "/home/test0208/tmp"
r_file= "$r _dir/
This iptables script is good, very practical, according to the actual application can be changed to use their own. Share it for everyone to refer to. The original author anon. The source code is as follows:
Copy Code code as follows:
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
In a multiple-machine cluster environment, often faced with the modification of the configuration file after copying to multiple servers, the traditional implementation of the SCP is troublesome, so write the following shell script, you can copy the
Wrote a little shell instance of myself, though very small, but all the big programs are stacked up by small modules, programmers must understand a script writing, and I, will only work under Linux, so you can only write Linux shell script, oh, this
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