Shell programming and automatic operation and maintenance implementation

Linux Shell programming and automatic operation and maintenance realization variables

Linux Shell programming and automatic operation and maintenance

Realization of Linux Shell programming and automatic operation and maintenance Cycle

Linux Shell programming and automatic operation and maintenance implementation Arrays and functions

Linux Shell programming and automatic operation and maintenance implementation Three Musketeers

Realization of Linux Shell programming and automatic operation and maintenance

what is shell

 Features of the shell language

  • The SHELL language refers to the command language of the UNIX operating system, and it is also the abbreviation of the interpreter of the command language.

  • Shell itself is a program written in C language. It is a bridge for users to use Unix/Linux. Most of the work of users is done through Shell.

  • Shell is both a command language and a programming language. As a command language, it interactively interprets and executes commands entered by the user;

  • As a programming language, it defines various variables and parameters, and provides many control structures found in high-level languages, including loops and branches.

  • Although it is not part of the Unix/Linux system kernel, it calls most of the functions of the system kernel to execute programs,

  • Create files and coordinate the execution of programs in parallel.

  • Therefore, the shell is the most important utility for the user,

  • In-depth understanding and proficiency in the characteristics of the shell and how to use it is the key to making good use of the Unix/Linux system.

What the shell can do

1. Automated batch system initialization program (update, software installation, time zone setting, security policy...)
2. Automated batch software deployment program (LAMP, LNMP, Tomcat, LVS, Nginx)
3. Application management program (KVM, cluster management Capacity expansion, MySQL, DELLR720 batch RAID)
4. Log analysis processing program (PV, UV, 200 code, !200 code, top 100, grep/awk)
5. Automatic backup recovery program (MySQL full backup/incremental + Crond)
6 . Automated management program (batch remote password modification, software upgrade, configuration update)
7. Automated information collection and monitoring program (collection of system/application status information, CPU, Mem, Disk, Net, TCP Status, Apache, MySQL) 8.
Cooperation Zabbix information collection (collect system/application status information, CPU, Mem, Disk, Net, TCP Status, Apache, MySQL)
9. Automatic capacity expansion (adding cloud hosts --> business online)
zabbix monitoring CPU 80%+|-50% Python API AWS/EC2 (add/delete cloud hosts) + Shell Script (business launch)
10. Tetris, print triangles, print Christmas trees, print pentagrams, run small trains, tank battles, sorting algorithms
11. Shell can do anything things (everything depends on business needs)
 

Shell execution mode

The way of 1 and 2 is the way of subshell
3 and 4, it is the shell

  • Execution 1: bash ping01.sh

  • Execution 2: sh ping01.sh

  • Execution 3: .bash.sh

  • Execute 4: source bash.sh

What are the shell interpreters?

What are the shells supported by Linux?
cat /etc/shells
or
chsh -l

Guess you like

Origin blog.csdn.net/SongLiang02_/article/details/132416833