Anti-counterfeiting code: Learning without thinking is blind, thinking and not learning is dangerous Test disk alert scripts with Xshell1. Open a centOS6.5 virtual machine and change the network adapter to bridge mode.650) this.width=650; "Src="
Error:/usr/local/bin/stop.sh:line 3: [: 2151:unary operator expectedReason:The shell script name is stop_tomcat.sh and will never be executed else because the script itself contains the Tomcat,shell script to find out Stop_tomcat This process is the
OperatorsThe shells use arithmetic operators from the C programming language, in decreasing order of precedence. Math Operators
OPERATOR
DESCRIPTION
++−−
Auto-increment and auto-decrement, both prefix
-eq equals-ne Not equal to-GT Greater than-lt less than-le less than or equal to-ge greater than or equal to-Z Empty string= Two characters equal! = Two characters are not equal-N Non-empty stringStrings are commonly used to check user input,
In a Linux system, you can use FDISK to partition the hard disk, but to manually execute a lot of commands, it is cumbersome to use, and now remember that a script with Fdisk is automatically executed.1 #make Partition2Ddif=/dev/zero OF=/DEV/MMCBLK1
[Email protected] zuoye]#CatQuansges.SH #!/bin/Bash>file[ ! $#-ge3] &&Echo "Please input three number or more number!"&& exit2||Echo$* >file forIinch$* Do Expr$i +1&>/dev/NULL [ $? -ne0] &&Echo "Input is error"&&Exit Donea=`Cat file|Xargs-n1|Sort-
Shell for LoopThe general format for A for loop is:For variable in listDoCommand1Command2...CommandNDoneA list is a sequence of values (numbers, strings, and so on), each separated by a space. Each time the loop is passed, the next value in the list
Do you write a shell that is encrypted in the production environment? Anyway, I do not, the online environment to see the Bai, feel nothing. In fact, it seems that there are several benefits.1, simple encryption, to prevent others from looking
Parameter extension:1. The parameter referenced by the name is called a variable2. Parameters referenced by numbers are called positional parameters3. Parameters referenced by a particular symbol have a special meaning and purpose, and are referred
Shell scripting is an essential skill for Linux OPS engineers and a very important skill, so it's only good to learn shell programming well. Basic grammar I will not speak, learn the C language of these languages, a little bit to understand the
The introduction of test statements in Linux can help us improve the efficiency of our tools and reduce the intensity of our work. So this article mainly introduces the introduction and usage of the test statement in the shell script of Linux.I.
1.BASH (Bourne again Shell)cmd1; cmd2 equals to CMD1CMD22.echo Music; The semicolon is not printed because the semicolon defaults to the command-bound symbol3. Use Pgrep to identify process environment variables[Email protected] shell]$ pgrep compiz4
ShellThe first type:${parameter%word} minimal truncation of word from behind${parameter%%word} to maximize the truncation of word from the back${parameter#word} minimal truncation of word from the front${parameter# #word} to maximize the truncation
condition Test1. Condition testing: Test [The command test or [can test if a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false,The exit status of the command is 1 (note the exact opposite
Let, (()) and [] perform basic operations in bash, and advanced operations will use expr and BCLet# Let Result=x+ySelf-adding operation# Let X + +Self-decrement operation# Let x--Shorthand form# Let X+=6---Let x=x+6#let x-=6--Let x=x-6[]# y=$[2 + 1]#
Command substitutionIn bash, $( ) and ` ` (anti-quote) are used for command substitution.command substitution is similar to variable substitution, which is used to reorganize the command line, complete the command line in quotation marks, and then
All variables in bash are stored as strings, and the ENV command can view the environment variables associated with this terminal process.View environment variables for a process1. Get the PID of the program, such as Java# pgrep Java234922. View the
One, if condition statementFormat:An IF condition expressionThen #当条件为真时执行以下语句Command Listelse #为假时执行以下语句Command ListFiIf statements can also be nested usingIf condition expression 1ThenIf condition expression 2ThenCommand ListElseIf condition
The file descriptor is an integer associated with the input and output of the file, which is used to track open files, and the file descriptor 0,1,2 is reserved by the system.0--stdin (standard input)1--stdout (standard output)2--stderr (standard
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