Day eleven regular expressions and Shell Basics learning

Source: Internet
Author: User

Regular Expressions           A regular is a way to describe a character or string by combining symbols with special meanings, called regular expressions. Or, the regular is the rule used to describe a class of things. Life is full of regular: two grep  parameter-N: Display line number-o: Show only matching Content-Q: Silent mode, no output, you have to use $? To determine whether the execution succeeded, that is, there is no filtering to the desired content  -l: If the match succeeds, only the file name is printed, Failure is not printed, usually-rl together, grep-rl ' root '/etc-a: If the match succeeds, the matching row and its last n rows are printed together B: If the match succeeds, the matching row and its first n rows are printed together with-C: If the match succeeds, Prints the matching rows along with their n rows--color-c: If the match succeeds, print the number of rows matched to-e: equals egrep, Extend-I: Ignore case-V: Inverse, mismatch-w: matches the word ^ line footer. 0 or more of the leading characters in any single character other than the line break. * All characters in the [] character group [^] the inverse of each character within a character group (unmatched by each character within a group of characters) ^[^] A line that starts with a character in a non-character group [a-z] lowercase [a-z]  lowercase and uppercase letters [0-9] number one what is the shell script  the OS commands into the executable file, from top to bottom in order to execute the OS command in the text is the script. Coupled with some intelligent (conditional/flow control) controls, it becomes an intelligent script. .  back to top   Two variables  part1 why should a variable program run is a variable of some column state variables and variable values to represent Part2 Variable naming rules begin with a letter or an underscore, and the rest can be: letters, numbers, underscores .  is best followed by the following specifications:  1. Start with a letter 2. Use an underscore or underline to make a connection to a word 3. The same type is distinguished by a number 4. For files preferably plus extension names such as: SQL_BAK.TAR.GZ,LOG_BAK.TAR.BZ2PART3 system Variable set and env difference set: Show all variables env: environment variable PART4 variable assignment varname=valueecho $VARNAME Delete variable unset VARNAMEpart5 Common system Variables Path,pwd,lang,home,histsize,ps1,iFS Domain delimiter is a space, wrapping, TAB key,  part1 arithmetic operator +,-,*,/,%[[email protected] ~]# echo $[3+1]4part2 relationship operation with (()) <> <=>===!=&&| | Part3 assignment operator =+=*=/=%=

Day eleven regular expressions and Shell Foundation learning

Related Article

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.