Advanced shell programming and advanced shell programming

Source: Internet
Author: User
Tags define local

Advanced shell programming and advanced shell programming

0. Basic knowledge required by shell scripts

-Vi/vim editor commands, including vimrc settings;

-Linux Command Basics

-Network service (nfs, rsync, inotify, lanmp, sersync, ssh key) Batch Distribution Management

 

1. Introduction to shell scripts

1.1 What is shell

1.2 What shell script

1.3 role of shell programs in O & M

1.4 types of scripting languages

1.4.1 types of shell script language

1.4.2 other commonly used script languages

1.5 OS default shell

1.6 create and execute shell script

2. shell Variables

2.1 variable type

2.2 Environment Variables

2.3 custom environment variables (global variables)

2.4 display and cancel Environment Variables

2.5 local variables

2.5.1 define local variables

2.5.2 special Variables

2.5.3 internal variables

2.5.4 variable quantum string operation

2.5.5 variable Numerical Calculation

3. Conditional Test

3.1 Test statement

3.1.1 condition test syntax

3.1.2 file test operators

3.1.3 string test operators

3.1.4 integer binary comparison operator

3.1.5 logical operators

3.2 conditional test example

3.2.1 file test example

3.2.2 string test example

3.2.3 integer test example

3.2.4 test command test usage

3.2.5 example of logical operators

4. Branch and loop structure

4.1 if statement

4.1.1 if clause syntax description

4.1.2 if clause example

4.1.3 multi-condition if Statement (&, |)

4.2 case mechanism Condition

4.2.1 case clause syntax

4.2.2 case structure conditional sentence self-writing example

4.2.3 System script example of case structure conditional statements

4.2.4 system benchmark script

4.3 When and

4.3.1 when and until loop syntax

4.3.2 basic examples of when and until Loops

4.3.3 examples of advanced production

4.4 for Loop Structure

4.4.1 for loop structure syntax

4.4.2 basic example of for Loop Structure

4.4.3 for loop structure example

4.4.4 advanced for loop structure example

5. break continue exit

5.1 Comparison of break continue exit

5.2 break continue exit example

6. shell functions

6.1 shell function syntax

6.2 shell function execution

6.3 shell function example

7. shell script debug

7.1 common Script Error Examples

7.1.1 if condition sentence does not have the keyword ending with if

7.1.2 keyword error missing in loop struct

7.1.3 an error is caused when the pair of symbols are unordered.

7.1.4 errors caused by no space at both ends of [] brackets

7.2 shell script tuning skills

7.2.1 use the dos2unix command to process the script

7.2.2 debug with echo command

7.2.3 use bash command parameters for debugging

7.2.4 use the set command to debug some script content

8. shell script development habits, specifications, read-only

8.1 naming rules

8.1.1 version and running parameters

8.1.2 variable name

8.1.3 function name

8.1.4 script (module) Name

8.1.5 temporary file name

8.2 code style specifications

8.2.1 code framework

8.2.2 Function Specification

8.2.3 conditional statements and loops

8.3 annotation Specification

8.3.1 file/module comment

8.3.2 important function comments

8.3.3 good habits of writing comments

8.4 reference symbol usage Specification

8.5 log specifications

8.6 interface file specifications

8.7 configuration specifications

8.7.1 configuration file specifications

8.7.2 check configuration items

8.8 script storage specifications

8.9 supplement normative development habits

9. Configuration adjustment and optimization of the shell Development Environment

9.1 configure SecureCRT terminal vim shell Environment

9.2 vim shell environment Functions

9.2.1 SecureCTR terminal vim automatically adds copyright function Information

9.2.2 automatic brackets filling function in the vim Editor

9.2.3 Automatic completion functions such as functions in the vim Editor

9.2.4 automatic indent, highlight, and so on in the vim Editor

9.3 configure the vimrc implementation code and parameters in the vim shell Environment

 

 

  

7.2 shell script debug skills

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.