Shell sorting algorithm: An improved insertion sort algorithm

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,

Linux bulk Backup server configuration files and directories script _linux Shell

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.

Implement server monitor and alarm small script with Shell+sendmail _linux shell

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)

Shell script implementation of guessing number games _linux shell

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

Shell string Operations detailed _linux shell

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

Shell script implements recursive delete empty folder _linux Shell

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 #

GETCWD Cannot access parent directories error resolution _linux Shell

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

Examples of different data transformations in shell scripts (binary, octal, 16, base64) _linux Shell

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

Shell script implementation upload zip compressed file to FTP server _linux shell

Copy Code code as follows: #/bin/bash # Creator:lihuibin # date:2014-03-10 16:45 # Desc:upload file to FTP Hosts= "192.168.56.100" Port=21 User=test Pass=testpwd Work_path= "/var/www/cms" Packname= "Publish" #hosts =$1 #port =$2

Shell script Programming If statement learning Notes _linux Shell

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

Shell script string The difference between single and double quotes _linux shell

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

Centos/rhel implementation Nginx Self-startup script instance _linux Shell

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:

5 examples of getting Started with Shell scripting _linux shell

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

How to use IF statements in bash scripts _linux shell

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

Use of the sort sort command under the shell

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

"Lazy shell script" seven--format processing data into the database implementation

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?

Shell programming Multi-branch Case statement

1. Structure  2. Case studies#!/bin/bashecho "Wayne:input 1" echo "echo : Input 2" echo "We : Input 3" read-t 30-p "Input your choice:" Choca Se "$cho" in "1") echo "Wayne Love echo" ;; " 2 ")

Comparison of strings and values in the shell

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,

Shell script to monitor disk usage (local + remote)

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

Linux limits two shell scripts to execute simultaneously

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  

Total Pages: 541 1 .... 142 143 144 145 146 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.