From: http://blog.sina.com.cn/s/blog_7c95e5850100zpch.htmlSuppose there is a variable var=http://www.linuxidc.com/test.htma # Intercept, delete the left character, and leave the right character. echo ${var#*//} where var is the variable name,#
Similar to other programming languages, the shell supports A for loop.The general format for A for loop is:For variable in list do Command1 command2 ... CommandndoneA list is a sequence of values (numbers, strings, and so on), each
-Execute one command at a timeM!-Executes a shell command and puts the result in the current edit bufferC-u M!=============================The following formally enters the shell edit buffer=============================-Start Shell Edit bufferM x
Shut down the system: shutdown [options] [TIME] [warning message]-K does not really shut down just send a warning message to all users-R restart immediately after shutdown-H does not restart after shutting down the machine-F Quick shutdown without
Good newsGood newsGood newsGood newsGood newsGood news, this series of scripts has been opened on GitHub, I named "Easy Shell " (Click this entry).Now that you have included the scripts in the previous installments, there will be many other scripts
On the BBS saw the Shell 13 asked the post, because the comparison is far away, afraid later can not find, put the notes over,Original address:Shell 13 AskHttp://bbs.chinaunix.net/thread-2033675-1-1.htmlPost the notes I made:, why a Shell user
The following are some of the more commonly used command line or shell scripts that are extracted during the deployment of OpenStack, for informational purposes only.1. Kill all existing zombie processesPs-ef | grep Defunc | Grep-v grep | awk '
$# the number of arguments passed to the script$* displays all parameters passed to the script in a single string. Unlike positional variables, this option parameter can be more than 9$$ the current process PID number for the script to run$! Process
1. CycleThe shell loops and executes a program continuously until the condition is met. Loops are divided into 4 types, while loops, until loops, for fixed processing, for numeric processing.2. While loopThe while loop is executed until the
1. Test SwitchSome test instructions are included in the shell, and the following table lists the meanings of these test instructions and whether they are available for the test command, bash, Ksh.
Switch
Test
Bash
Ksh
Meet
Meaning
&&
Command1 && command2: Command 1 returns True (Command return value $ = = 0), command 2 can be executed. Can be used for if judgment.CP 1.txt.. /&& echo "succes" #-->successCP 1.txt.. /&& rm-f. /1.txt && echo
Defining functions in the shell allows the code to be modularized to facilitate reuse of code. But the scope of the variables and functions of the script itself can be confusing, and here's a look at the problem.(1)The variables defined in the shell
First, conditional statements
Simple conditionsif Then # When the condition is established, the content is executed;fi If the reverse is written, the meaning offiif
Complex conditionsif Then # When condition is established, execute
Classic Sort algorithm-Hill sort Shell sortHill sort Shell Sort is an improvement based on the insertion sort , which is also divided into two parts,The first part, Hill sort IntroductionThe second part, how to choose the keyword, the key is to
No wget first download get command yum-y install wget1. Download Peanut shells[Email protected] ~]# wget http://download.oray.com/peanuthull/linux/phddns-2.0.6.x86_64.tar.gz2. Unzip the tar.gz[Email protected] ~]# tar zxvf
RHEL automatically installs the zookeeper shell scriptRHEL automatically installs the zookeeper shell script
A: This script runs on Linux RHEL6.
B, C, D,...: The machine on which zookeeper cluster is to be installed, Linux RHEL6
First, you can log
Shell script to replace the tomcat cluster war package
Run the command to log on to the server without ssh.
The configuration file does not change much to overwrite the previous configuration.
Profile configuration file
Bak =/home/wsm/bakWebapps
A linux shell script that modifies the configuration file,
Not long ago, I found a Blog reading the configuration file.
Now, you need to set up an interface for users to modify similar configuration files through the web interface. The big way is to
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.