Shell variables are divided into environment variables and custom variables, the difference is whether the variable can be used in the quilt process, look at the following diagram:
If you are an environment variable, you can continue to use it in
# scripts are only for Exchange learning and use!
# The current version of the script is 1.0. Implements the creation of physical volumes, removing, changing (enabling/disabling assignments), scanning, viewing features.
# The following will
Often toss WordPress friends will usually build a local environment, debugging finished and then released to the line, as to how to install in the local WordPress, this can refer to my previous write a "relaxed 10-step local installation of
First, the common skills
Copy Code code as follows:
SSH User@server Bash #ssh到远程服务器执行一个脚本, this command avoids uploading scripts to a remote server
SSH User@host Cat/path/to/remotefile | Diff/path/to/localfile-
awk regular Expressions and built-in function examples are detailed:
1, Fuzzy matching:
Copy Code code as follows:
awk ' {if ($3~/97/) print $} ' DATA.F: Print the line if "97" is included in the third item
awk ' {if ($4!~/ufcx/)
Linux text processing tools are very rich and powerful, such as a file:
Copy Code code as follows:
Cat Log
Www.jb51.net 192.168.1.1
Www.jb51.net 192.168.1.1
Www.jb51.net 192.168.1.2
Ffffffffffffffffff
Ffffffffffffffffff
Add: This is valid for the first time to add a network card, if you need to repeat the addition and deletion of automatic configuration, you need to change the script, according to the IP a command information to modify.
Copy Code code as
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
Today, my company colleagues to my entire ADSL automatic redial shell, and detect whether connected to, so as to ensure that the internal test server does not drop the net, OK, I sent the script below.
System: CentOS 5.x
Script 1:
Copy Code
1. Background
When multiple processes may perform operations on the same data, these processes need to ensure that the other processes are not operating to prevent damage to the data. Typically, such a process uses a "lock file", which means that
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
In development, we often need to change the N-file encoding, ICONV can only make changes to a single file, how to do? Let's write a shell script to solve this problem.
Example one: Using shell script to implement bulk transcoding operation.
#!/
On-line Java application, in the peak of the Business Times often appear CPU run high, need to see real-time thread CPU situation, the following is a very good script, you can quickly export the CPU of each thread, combined with Jstack log, to the
The user uploads the picture, generally has not been compressed, causes the space to waste. So you need to write a program that looks up a picture file (jpg,gif,png) of directories and subdirectories, and compresses pictures that are larger than a
I. BACKGROUND
We have the Ubuntu Server 12.04 version installed on our servers, and because of the development environment, we have no centeos or red Hat, and we have a few big hard drives that need to be mounted to the root directory, which is not
Because Nginx is a high-performance http and reverse proxy server. Nginx has a strong advantage in reverse proxy, rewrite rules, stability, static file processing, memory consumption and so on. Therefore, most of the Web services on the company's
This article mainly introduces the basic syntax of if and common judgment usage in the shell, this article explains the basic syntax of IF, the judgment of the string, the judgment of the number, the judgment of the file attribute, the logic
In the shell, arguments can be passed to a function when it is called. Inside the function body, the value of the parameter is obtained in the form of a $n, for example, $ $ for the first argument, and $ = for the second argument ...Examples of
The shell quotesin the the shell often uses single quotes, double quotes, back quotes ( keys above the Tab key in the keyboard), backslashes ( meaning of some Shell metacharacters). If we sometimes want the echo command to output a character that
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.