当前位置:网站首页>18. Shell Scripting (1)
18. Shell Scripting (1)
2022-07-19 09:44:00 【51CTO】
Object oriented and process oriented
object-oriented : Everything is the object , Object is the concrete of class , A class is a collection of things ,python java c# golang etc.
Process oriented : Command centric , Data serves instruction , The problem is small , Step by step ,c shell
programing language
Low level assembly language 、 High level assembly language
Low level assembly language : The binary 0 and 1 Sequence
High level assembly language :
compile : High-level language - compiler - Machine code file - perform
explain : High-level language - perform - Interpreter - Machine code
Edit logical processing
Sequential structure process 、 Branch structure process 、 Cycle structure flow
shell Basis of editing
Format requirements : First line shebang Mechanism ( That is, tell the script written in which language )

1、 Create a text file using a text editor ( The first line must include shell Affirming #!)
2、 Add execute permission
3、 Run script (bash file.sh( The script does not require execution permission )、.\ file.sh( Relative paths ,x jurisdiction ) \data\file.sh( Absolute path mode ,x jurisdiction ))


PATH Add path execution

Script specification
1、 first line shebang Mechanism
2、 The program name
3、 Version number
4、 Time after change
5、 Information about the author
6、 The role of the script and precautions
7、 Brief description of previous versions
Remote site execution script

Script debugging
There are three common script errors
1、 Grammar mistakes , Will cause subsequent commands not to be executed , have access to bash -n Detect errors , The number of lines prompted is not necessarily accurate
2、 Wrong command , By default, subsequent commands will also be executed , use bash -n Can't detect , have access to bash -x To observe
3、 Logic error : Only use bash -x To observe



边栏推荐
猜你喜欢

ETH的拐点可能指日可待,这就是如何

MySQL--SQL优化案例--隐式字符编码转换

【ACWing】947. text editor

组件化高级--插槽

Detailed explanation of the different usage of PIP and PIP3

Flink小知识--任务调度slot的配置 slotSharingGroup

Flink small knowledge -- configuration of task scheduling slots slotsharinggroup

【ACWing】947. 文本编辑器

C language compilation process

实用工具系列 - Xshell安装下载与使用
随机推荐
R语言ggplot2可视化分面图(faceting):ggplot2可视化分面图并移除分面图之间的边框线、以及分面图之间的间隙(Remove Spacing between Panels)
Fundamentals of C language -- 2-3 pointers and arrays
[Luogu] p2357 tomb keeper
rhcsa 第二天 7.15
如何在监控主机上单独部署agent——WGCLOUD
18、shell脚本编程(1)
【洛谷】P2357 守墓人
Anaconda and jupyter notebook entry level detailed tutorial
redis缓存雪崩
开发第一个Flink应用
Makefile中在命令前加上- 则忽略该命令产生的错误,继续执行下一条命令
v-mode
Go-Excelize API源码阅读(二)——OpenFile()
Target detection model size calculation, model complexity (parameter conversion formula)
how to use culasLt
第4章-一阶多智体系统一致性 -> 连续时间含时延系统一致性【程序代码】
Part I - Fundamentals of C language_ 5. Arrays and strings
Part I - Fundamentals of C language_ 3. Operators and expressions
How to synchronize historical data when MySQL is upgraded to primary and standby?
Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS) (found suitable exact version “11.4“)