Trigger Brief1, Trigger basic concept2. Trigger syntax and practical examples3, before and after differencefirst, the basic concept of triggers1. Triggered2. Role: Monitor a situation and trigger an action3. Observe the sceneAn e-shop:Product list,
If statementThe judging condition is wrapped up in []If [$a > $b]ThenEcho ' a > B 'elif [$a ThenEcho ' A ElseEcho ' A==b 'Fi for StatementIterating through an arrayFor arr in ${array[*]}DoEcho ${arr}Done while StatementIf the value of the
Open a text editor, create a new file, the extension sh (sh for Shell), the extension does not affect the execution of the script, see the name is good, if you write a shell script in PHP, the extension is good with PHP.Enter some
Ubuntu often prompt to update the kernel, update several times after the/boot directory is full, and then update the hint directory no space, this time you need to remove the old kernel, before all is uname, grep, dpkg and other commands to knock,
The shell is actually a program that has a special function, mainly to provide a user interface with the kernel to interoperate. It is located between the user interface and the kernel, the workflow is to receive commands entered by the user and
The Shell also supports functions. The shell function must be defined before use.Definition and invocation of a functionThe Shell functions are defined in the following format:Function_name () { List of commands [return value]}function return
I. Script structureThe script for the shell under Linux is to write a series of command sequences in a text file, and this text file can be executed. Development efficiency increases relative to the command line. So his architecture has 2 parts that
Write Shell script:1) Editor like VI or Mcedi2) Set Execute permission for your scriptchmod permission Your-script-namechmod +x your-script-namechmod 755 your-script-name This would set read write execute (7) permission for the owner, for group and
There are three types of conditions that are commonly tested in bashConditional test expression: [expression] [[expression]]First: Integer test:-eq tests whether two integers are equal, such as [$A-eq $B]-ne test two integers in different sizes-GT
Code: Script_name parameter1 parameter2 Parameter3 ...It's easy to guess that the $ A is the shell script name (path) itself, and $ $ is the first argument, and so on .... you have to pay attention to the role of IFS, that is, if IFS is quoting,
Syntax for the FOR loop:1. For variable in value 1 value 2 value 3 ....DoProgramDoneFor example: The following script will print 4 times respectively the value of morning noon afternoon evening1 #!/bin/bash2#打印时间 3#Author mrfeng45 for-time in
1. Single-branch if condition statement1 if [conditional judgment type]; Then 2 program 3fi4 or 5if [conditional judgment]6 then 7 program 8fiPrecautions:The 1.if statement uses the fi end, and the general language uses curly
Summary of this chapterVariables are a must in a very small program . The shell variable retains the string value , and a large number of operators can be ${var ...} used in , let you control the result of the variable .Shellprovides a number of
Case judgment in the shellFormat: Case variable name invalue1)Command;;value2)Command;;*)Commond;;EsacIn a case program, you can use a |, meaning, or means in a condition, such as:2|3)Command;;When the variable is 2 or 3 o'clock, the part of the
This document is referenced from http://www.cnblogs.com/zhuyp1015/archive/2012/07/11/2586985.htmlAWK: useful Data processing toolsAwk is also a great data-processing tool! SED is often used for the processing of an entire row, and awk prefers to
1. To use the shell script in makefile, you need to add the "@" symbol, for example:@if [-D xxx]; Then \//-d to determine the existence, in the shell, with the [] number instead of parenthesesRM-RF xxx; \Fi@cp-FV xxx xxxx//-f Delete the existing
A brother in the forum to toss two variables at the same time, do not know how to toss. Later learned that you can use an arrayAll forget the shell and the array.wrote a test program. Record it. I also have an impression in the
Frequently used shell commands for updating Mac server services, and mac server shell commands
On the Mac server, you must enable remote logon. Enable: system preference settings-> share check remote LogonCommon Commands include:
Copy (copy the
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