+++++++++++++++++++++++++ +++++shell Programming +++++++++++++++++++++++++++++++
1. Basic Regular Expressionsregular expressions and wildcard characters:regular expressions are used to match conditional strings in a file, Regex contains matches, grep awk, and other commands can support regular expressions; Wildcards are used to match qualified file names, wildcards are exact matches, LS find CP these commands do not support regular expressions, so you can only Match with the Shell's own wildcard characters. Basic Regular expression:
2. Character Intercept commandsField Extraction command: Cut [options] file nameoption:-F (Extract columns)-D (split column by specified delimiter)Note: Limitations of the Cut command formatted output command: printf ' output type output format ' output contentOutput Type: output Format: Note: The print and printf commands are supported in the output of the awk command, except that print automatically adds a newline character. intercept the specified column: awk ' condition 1{action 1} Condition 2{action 2} Condition 3{action 3} ... ' File name (same as Cut command function, but more powerful than cut function)conditions--general use of relational expressions as criteriaactions--formatted output or Process Control statements Stream Editor: sed [options] ' [action] ' file nameoption:-N (outputs the corresponding line)-e (allows multiple SED action edits to be applied to input data)-I (the file that reads the data directly with the result of the SED modification, not the screen output)Action: Note: SED is a lightweight
flow editor that is almost included on all UNIX platforms. The SED command is primarily used to select, replace, delete, and add commands to the data.
3. Character processing CommandsSort command: Sort [Options] file nameOptions: statistics command: WC [option] File nameOptions:-L (count rows only)-W (count only words)-m (count characters only)
4. Conditional JudgmentJudging by file type to judge by file permissions compare between two files A comparison between two integers the judgment of a string Multiple Conditional Judgments
5. Process ControlIf statementSingle Branch if statementDual-Branch if condition statementMulti-branch if condition statementMulti-branch case condition statementFor LoopWhile loops and until loops+++++++++++++++++++++++++ +++++shell Programming +++++++++++++++++++++++++++++++
Linux Learning Note--shell Programming (ix)