Logical judgment in the shell

1.if judgment① simple judgment, if the condition is met, return OK#!/bin/basha=5if [$a-gt 3]then echo "OK" fi[[email protected] test_shell]#./test.shok② two conditions, you can use elif and else#!/bin/basha=5if [$a-lt 3]then echo "Common symbols in

Tai Hang record-shell script delete operation

BackgroundJenkins executes the shell command, which references some Jenkins variables, such as ${workspace}, because each execution of Jenkins is slow, so I want to copy the script to local debugging, directly copied the script to execute, the

Shell Script Foundation II

Processing of strings1. Interception of stringsMethod one, using the ${} expressionFormat: ${var: Start position: Length}Phone= "13788768897" # echo ${#Phone} 11 When you use ${} to intercept a string, the

Shell decompression package, the sum of all the text of the packet under the recording duration

#!/bin/bash#from为压缩包批次所在目录#basetarpath to count the total length of time per batchFrom=$1Basetarpath=$2suffix= "Tgz"Todir= $basetarpathoutdir= $basetarpath/home/iflytek/outif [!-d? $from]; ThenExitFiif [!-D $basetarpath];thenMkdir-p

Shell Beginner (iii) pass the argument

OneScript code: test.sh"Shell passed argument instance!" "; "file name executed: $"; "The first parameter is: $ $"; "The second parameter is: $"; "The third parameter is: $ $";Execute the file name:./test. SH The first parameter is:1 the

Getting Started with Linux fifth day--shell script (bottom) looping and debugging of basic grammar

first, the circulation  1. Indefinite circulation  There are two kinds of forms: while [Condition] state in parentheses is the beginning of the loop of the judgment do done do is the end of the loop  When the condition condition is established,

Shell Simple Script Writing

vim/root/7.sh#!/bin/bashX=$[RANDOM%10+1]Read-p "[1-10] you guessed:" CaiIf [$cai-eq $X];thenEcho, congratulations on your guess.Exitelif [$num-gt $X];thenEcho's a big guess.ElseEcho's too small.Fivim/root/6.sh#!/bin/bashRead-p "Please enter a

Easy Cool CMS local contain vulnerability take shell

Beta version: Easy cool cms2.5Contains a sentence: Http://localhost/ekucms2.5/?s=my/show/id/{~eval ($_post[x])}will generate an error log in the/temp/logs/directory of the website, naming rules for the year _ month _ DayError log contentsContains

Linux Shell Programming-Regular expressions

First, the basic regular expression1. Regular expression: The regular expression is the string used to match the symbol condition in the file, and the Regex contains the matchinggrep, awk, sed, and other commands can support regular expressions.2.

Linux5.2 Shell based on

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

Shell introduction, history commands, command completion and aliases, wildcard characters, input and output redirection

Shell IntroductionThe shell is the intermediate medium used when the system interacts with the computer hardware, and it is just a tool of the system. There is a layer of things between computer hardware-the system kernel. If computer hardware is

Linux Learning (22) Shell Foundation (ii) Variable, environment variable profile

One, variableA variable is a container in which different values can be placed.Key facts:Path,home,pwd,logname these are variables.Example:[[email protected] ~]# echo +ba+~]# echo $a +$b3+4~~ ]# echo $a 3$b4~]# echo $a"3"$b334 The summation of

Shell programming Develop good habits

1. Export path= $PATH:/usr/local/mysqlPut the $path in front, or to add to the path inside of the way to write the wrong words, you are tragic, processing is still more troublesome2. crontab inside Execute script remember Source/etc/profileCrontab

Shell exercises-processing logs

Write a script to find the/data/log directory, the last created time is 3 days ago, the suffix is *.log file, packaged and sent to 192.168.1.2 Service under/data/log, and delete the original. log file, leaving only the packaged

Shell programming--looping statements

2. Case statementOnly one conditional relationship is judgedGrammar:Case¢ variable name in"Value 1")Procedure 1;;"Value 2")Procedure 2;;*)Procedure 3;;Esac3. For loop1) Syntax: (Assigning a value to a variable executor, several values are executed

Linux--Shell programming

Linux--Shell programming one, regular expression 1, regular expression PK wildcard        2.Basic Regular Expressions1),*The previous character matches 0 or more times~ grep "A *" Test_rule.txt # matches all content, including blank lines~ grep "aa*"

5th day (half day) "Shell programming preliminary, grep and regular Expressions"

Day 5th (half day) "Shell programming preliminary, grep and regular expression" shell programming preliminary (_RECV)Shell script: Text file#!:/ Bin/bash#!:/ Usr/bin/python#!:/ Usr/bin/perlCase Listing 1:Vim first.sh#!:/

Shell Common Scripts

Shell Common ScriptsAuthor:headsen Chen 2017-10-17 15:36:17Personal original, reproduced please indicate, otherwise, legal liability shall be investigated1,vim name.grep.sh2,cat tellme.sh3,cat idcheck.sh4,cat case.shNote: The file name is called in

Shell's looping nesting syntax

To test the shell's looping nesting syntax1[Email protected] test]#VIXunhuanqiantao.SH 2#!/bin/Bash3 #程序功能描述:4 # test Loop nesting5 #作者: Lone boat Point6#版本:1.07#创建时间: .-Ten- A Geneva: $:

Shell programming echo command usage instructions, shell programming echo command

Shell programming echo command usage instructions, shell programming echo command Shell echo commands are similar to PHP echo commands and are used to output values. We can use echo to implement more complex output format control.Show normal

Total Pages: 541 1 .... 516 517 518 519 520 .... 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.