The shell sorting algorithm was first proposed by the D.L shell in 1959, assuming that the elements to be sorted have n, then each insertion sort is not the same as the elements, but goes to an interval.
The shell first sets the interval to N/2,
Function:1. Only in the backup machine, the remote server only need to allow the backup machine with root through the key login;2. Configure which servers to back up on the backup machine, add or subtract the array in need_backup_servers;3.
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)
The generated password and user input can accept duplicate numbers.So the relative general rule of guessing numbers may be much more difficult.
This version of the rule:
a--numbers are right, position is right.b--excludes the result of a, the
1, the shell variable statement judgment
An expression
meaning
${var}
Variable var with the same value as $var
${var-default}
If Var is not declared, then use $default as
Sometimes we need to delete the empty folder recursively, search the internet for a while, did not find a better shell script, so we wrote a
Script
Copy Code code as follows:
#!/bin/bash
# Author: Ten years later, Lou's brother
#
Copy Code code as follows:
[Root@web-server php]#/etc/init.d/httpd Restart
Shell-init:error Retrieving current Directory:getcwd:cannot access parent directories:no such file or directory
This error indicates that the GETCWD command could
The shell can represent different data in the system without invoking the 3rd party command. The following presentation method is summarized here. The default value of the shell script is handled by the 10 number, unless the number has a special
I am not studying things under Linux, so here is only a description of the use of shell script, I am in the process of using the problem recorded, but also write down some of the rules of the shell script syntax, easy to view later. Let's take a
Basic knowledge of strings
Strings are the most commonly used data types in shell programming (except numbers and strings, and nothing else works), strings can be in single quotes, double quotes, or without quotes. The difference between single and
Usually in the CentOS, Rhel OS, we mostly through the chkconfig to manage services, such as the boot automatic service.Here to introduce a very useful nginx startup script. and simple to use, as follows:
1. Execute the following order:
Example one: Drawing special graphics
Copy Code code as follows:
#!/bin/bash
Max_no=0
Echo-n "Enter number between (5 to 9):"
Read Max_no
if! [$MAX _no-ge 5-a $MAX _no-le 9]; Then
echo "WTF ... I ask to enter number
In addition to the "If,else" form, there are other forms of "if" statements:
Copy Code code as follows:
if [condition]
Then
Action
Fi
The statement performs an action only if condition is true, otherwise the operation
First set up a file, very messy, no rule:
A positive sort:
Inverted sort:
Uniq Delete duplicate rows in a file: Use this command to sort the files first.
For file redundancy, as long as all duplicate characters of the file are displayed
0. IntroductionEncountered in real-world application development: Storing unformatted file data in a database. For traditional formatted data: Ini/json/xml We all have a ready-made class library to implement. What about non-formatted data like this?
Original: http://apps.hi.baidu.com/share/detail/31263915In the shell, the comparison between the string and the numerical method is different, pay attention to distinguishInteger comparison:-eq equals, such as: if ["$a"-eq "$b"]-ne not equal to,
Any partition used to 90% send a message to the specified recipient, to 95% on the subject of the message Warning (warning), instructions to send mail program email#!/bin/bash#Updated: 2008-03-03 PM by:leif ([email
The problem arises because the current release is used by executing scripts, all of which are mvn packaged, while execution causes problems.The solution checks, locks 、、、 before the script executes#!/bin/bash{flock -n 3 if [ $? -eq 1 ]then echo
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