for while until loop
for loop
In practical work, we often encounter the situation that a task needs to be executed multiple times, and each time it is executed, only the processing objects are different and other commands are the same. For example, create a system account according to the name list in the address book, and check the survival status of each h ...
Posted by plsanders on Mon, 14 Feb 2022 10:00:17 +0100
Chapter 10 10.1 what is a shell
10.1 what is a shell
(1) What is Shell
Shell is the medium used when the system interacts with computer hardware. It is just a tool of the systemIn fact, there is another layer between the system and computer hardware - the system kernel (1_1) record command historyThe commands we have executed in Linux will be recorded. By default, 1000 hist ...
Posted by BinaryBird on Fri, 11 Feb 2022 05:22:45 +0100
Shell programming - Judgment
1.Shell condition test
1.1. Numerical comparison:
Operator:
gt: greater thanlt: less thaneq: equal tone: not equal toge: greater than or equal tole: less than or equal to Test syntax:
Mode 1: test conditional expression [root@VM-0-17-centos ~]# test 8 -ge 2 / / no value is returned when the command is executed directly
[root@VM-0 ...
Posted by rn14 on Fri, 11 Feb 2022 01:59:43 +0100
Operation of array and algorithm
I Array definition method
Method 1
Array name= (value0 value1 value2 ...)
Method 2
Array name=([0] =value [1]=value [2]=value ... )
Method 3
List name="value0 value1 value2 ..."
Array name=($List name)
Method 4
Array name[0]="value"
Array name[1]="value"
Array name[2]="value"
☝ matters needing attention:
Ⅰ. Data types ...
Posted by phpuser_2000 on Thu, 10 Feb 2022 20:33:36 +0100
Shell script: shell function base
1. Functions
What is a function?
A function is a block of function code that can be used many times, a closed (space), and can be called freely in the code. Encapsulation of functions can reduce duplicate code development and improve code utilization. Functions can be passed along, using pre-defined content within the function to process ...
Posted by Cheap Commercial on Thu, 10 Feb 2022 17:49:33 +0100
shell script functions, arrays and bubble sorting
catalogue
1, shell function
1.1. Definition of function
(1) Format of function
(2) Function return value
1.2. Function call
1.3.return
1.4. Parameter passing of function
1.5. Scope of function
1.6. Local and global variables
1.7. Case of function
Factorial
Build local warehouse
2, Array
2.1. Definition of array
2.2. Array represe ...
Posted by A584537 on Wed, 09 Feb 2022 20:47:16 +0100
Advanced linux learning foundation
Linux learning
linux Process
Process concept From the perspective of users: a process is a running program. From the perspective of operating system: when the operating system runs a program, it is necessary to describe the running process of the program through a structural task_struct {}, collectively referred to as PCB, so for the oper ...
Posted by abhi_madhani on Thu, 03 Feb 2022 03:18:00 +0100
Regular expressions for Shell programming
1, Regular expression overview
linux text processing tool
Text processorBasic regular expressionExtended regular expressionvi editorsupportgrepsupportegrepsupportsupportsedsupportawksupportsupport
1. Basic regular expression
Metacharactereffect\Escape character, used to cancel the meaning of special symbols^Start position of matching str ...
Posted by sdaniels on Tue, 01 Feb 2022 15:35:49 +0100
Detailed description of sersync and frsync:
1.inotify+rsync
If you want to synchronize data regularly, you can add rsync to the scheduled task at the client, but the synchronization time granularity of the scheduled task can not meet the requirements of real-time synchronization. Inotify file system monitoring mechanism is provided after Linux kernel 2.6.13. Real time synchronization ca ...
Posted by vurentjie on Mon, 31 Jan 2022 15:06:49 +0100
100 out of the box shell scripts, CV method is good, and the work is not brain consuming!
Shell script is a sharp tool to help programmers and system administrators complete time-consuming and laborious boring work. It is an effective way to interact with computers and manage file and system operations. Just a few lines of code can make the computer close to acting according to your intention.
Brother Tian sorted out 100 examples f ...
Posted by Poolie on Sun, 30 Jan 2022 13:32:15 +0100