Process Control StatementsIn the shell if multiple commands are entered in the terminal, the commands are placed in the background if they are separated by &, and a collection of commands is represented if delimited. Shell allows logical operators
This is I learn to make notes or to make notes on their own easy to remember the format is very important examples are reference I also made the color on the impression notes to distinguish it on the top of it.
read for interactive scenarios
One, pipe and operation controlPipe character |: To pass the output of a file to the following commandgrep: A command used to filter a specified keywordApplication Examples:[[email protected] ~]# ls |wc-l//list How many rows are in the current
Shell Introduction
The shell is a command interpreter that provides interaction between the user and the machine
Supports specific syntax, such as logical judgment, looping
Each user can have their own specific shell
CentOS7
Format 1:if condition; Then statement; FiFormat 2:if condition; Then statement; else statement; FiFormat 3:if ...; Then ...; Elif ...; Then ...; else ...; FiLogical judgment expression: if [$a-gt $b]; If [$a-lt 5]; If [$b-eq 10] et-gt (>); -lt (=); -
1. Exit status of the command (1), (Kw:exit status)Each command has an exit state, represented by a non-negative integerStatus code 0 indicates that the command is running without errorsNon-0 Status code indicates a command errorThe range of status
To master a language, you must first master its grammar. As in C, the shell has its own syntax.VariableAs a rule, shell variables usually begin with an underscore, consisting of letters, numbers, and underscores of any length. There are two types of
1.shell script gets the native IP address:localhostip= ' lc_all=c ifconfig 'inet addr:'127.0.0.1' | '{print $}'"$localhostIP"2. Automate the setup of an IPSec test environment:#!/bin/Bash#sudo Suecho"Get root! "apt-get Install Strongswan-
Tag: Class begins with regular expression find parenthesis expression matches between awkRegular expressions and wildcard characters:1. The regular expression is used to match the qualifying string in the file , and the Regex contains the match .
There are three main steps to completing tasks and monitoring manually:1. mission_cron.php (timed automatic task script):2. Mission_cron_monitor (run by crontab, monitor the above script):#/bin/bash# Monitor the timer and disconnect the reboot. # #
First, the expression of the blockBecause the shell can not define a two-dimensional array, so can only use one-dimensional array to represent the box, Tetris can be divided into 7 categories, each type of block is composed of four types of small
Preface: Before we get to the point, let's review the conditional tests on scriptingOne, Process Control
Over-programming languagesA. Sequential executionB. Select executionC. Cyclic execution
Sequential executionAs the name implies, it is
One: function classification
Local function (local variable)local variable name. modifications to variables in the local function are only valid during the current function run. Func1 () {local Name=test;echo "func1:name= $name"; local
Shell Scripting Learning RecordWhy learn shell scripts?In some complex Linux maintenance work process, a large number of repetitive input and interactive operation is not only time-consuming and difficult, and error-prone, however, writing shell
1.1 How to use a file to test an expressionWhen we need to process an object in programming, we need to test the object and only take action to meet the requirements. The benefit of this is to avoid program errors and to consume system resources
23. Shell Introduction, Command history, command completion and aliases, wildcard characters, input and output redirectionFirst, Shell introductionThe shell is the intermediate medium that the system interacts with the computer hardware, it is just
The company project used Springboot. Applications that are developed need to be automatically uploaded to the server. Although the current thermal deployment is not fully mastered. First use the shell to simplify deployment.# upload Key Sshloginkey=/
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