Linux Shell Programming (vi): operations

Op-ExpressionsThe expression is contained in or (()) or [] within, An arithmetic expression:(()) ((expression)) This expression is calculated according to the rules of arithmetic calculation. Equivalent to let expression .

8.10 Shell Special Symbol cut command 8.11 sort_wc_uniq command 8.12 tee_t

8.10 Shell Special Symbol Cut command : Represents any arbitrary character? : Represents any single character#: Denotes comment characters\ denotes a de-semantic character| Represents a pipe characterThe Cut command is used to intercept a

Shell scripts: variables, file judgments, logical operations and other minutes

In the shell script, the variable definition, the reference each has the different way, in addition, very commonly has the file attribute judgment, the logical operation, the numerical operation and so on, the following record their attribute

About the shell script read the parameter issue

There are two ways to send a shell script:Way 1:sh file.sh arg1 Arg 2 ....Mode 2:read-p "hint" Arg 1 arg2The default parameters are directly separated by a space, following a few examples to explain the problems encountered in the communication and

Shell Script Programming Advanced

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

Shell string manipulation methods and examples

1. String length:Var=123abc456echo ${#var}9expr length $var 92. Specify character interceptionEcho ${var:5} #截取前五个字符c456echo ${var:2:5} #截取第2到第5个字符3abc4echo ${var: 3} 3 characters after intercept (with space on the left) 4563. Interception of

Use of wildcards and escape characters in a Bash shell

The wildcard asterisk number (*) represents a question mark (?) that matches 0 or more characters. Represents a matching single character in parentheses number ([0-9]) that represents a single digit character between matching 0~9 brackets plus the

Shell Programming Basics

Receiving user parameters#./example.sh One and threeThe Shell scripting language includes variables for receiving user parameters, and based on the above command, the commonly used variables are as follows: Use $ A To get the file name of

Shell Exercises (v)

Exercise 1:Delete the letters in the textRequirements: Delete the line containing the letters in the first 5 lines of a text document and delete all the letters from 6 to 10 lines (file 1.txt, lines greater than 10 lines)Reference Answer:#!/bin/bash#

Getting Started with Shell scripting basics

The article is for personal opinion, please correct me. Before we introduce the shell script, let's begin by understanding some basic concepts. What is a program? Process? The program is a set of instructions plus data, the following diagram

Shell to determine whether the stream file under the batch directory is processing complete

#!/bin/bashLog_error () {? ? ECHO-E $target date "+%Y-%m-%d %H:%M:%S" ["\033[31merror\033[0m"]: [email protected]? ? ECHO-E $target date "+%Y-%m-%d %H:%M:%S" ["\033[31merror\033[0m"]: [email protected] >> $LOG _file}Log () {? ? ECHO-E $target date "+

2>&1 usage instructions in the Linux shell

There are three standard input and output in Linux, namely Stdin,stdout,stderr, the corresponding number is 0,1,2.STDIN is a standard input that reads information from the keyboard by default;STDOUT is the standard output, by default output output

Linux Shell Basics (four) regular expressions and grep commands (in edit)

First, regular expressionBefore learning the Find command, we have been exposed to some simple regular, so we can now learn some complex regularization. First of all, we still have to review what is regular expression, see this tutorial first, must

Shell Pass Parameters

We can pass parameters to the script when executing the Shell script, and the format of the parameters obtained in the script is:$n. n represents a number, 1 is the first argument to execute the script, 2 is the second argument to execute the script,

Shell Programming-control structure

1.shell condition judgmentCommand: Test or [Use "[" to End With "]" and a space between judgment statementssuch as: Determine if the demo.c file existsIf [-F DEMO.C]Then...FiOrIf Test–f demo.cThen...Fi1.1 String Comparisonsstring1 = string2 Same as

Basic knowledge of shell scripts

1.shell command interpreter or shell auto-ops language2. How to execute a shell script(1) Execute permission must be given./first.sh(2) SH first.sh(3) Source first3. More complete Script compositionScript DeclarationComment InformationExecutable

Getting Started with Shell programming-bash tutorials

Shell script is similar to batch processing under Windows/dos, that is, the use of various commands pre-placed into a file, convenient one-time execution of a program file, mainly for the convenience of administrator settings or management. However,

Shell environment variables + special variables (definition of arrays and additions and deletions)

Shell variable type: (Divided into two categories)Environment variables (global variables) and local variables###### #一般环境变量都为大写 #########Three symbols of the variableNo quotation marks: usually consecutive strings, numbers, paths, etc. can be

Arrays in the shell

Arrays are not used very often in the shell, but are very useful, let's take a look at some of the uses of arrays in the shell: Define array a= (1 2 3 4 5); Print array echo ${a[@]}The contents of the array can be either numbers or letters, as

Shell: Shell Process Control details, shell Process Control details

Shell: Shell Process Control details, shell Process Control detailsShell: Shell Process Control details if else If statement Syntax: if conditionthen command ...fi Eg: #!/bin/basha=100b=100if [ $a == $b ]then echo "$a == $b"fi Output: 100 ==

Total Pages: 541 1 .... 262 263 264 265 266 .... 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.