Shell概述、解释器及基础入门

Shell概述

image.png

 

现在有一个强大的对手Python。

 

Shell解释器

常见的解释器sh、bash

image.png

最常用sh、bash

它们之间的关系

image.png

软连接 —>

其实还是调用bash

系统默认解释器 bash

image.png

 

 

入门案例

1、脚本格式

脚本以 #!/bin/bash开头(指定解释器)

 

 

helloword

2、第一个Shell脚本

 

image.png

 

image.png

 

image.png

 

使用解释器来解释脚本文件

 

image.png

 

image.png

 

直接执行,需要执行权限

 

多命令处理

 

3、第二个Shell脚本:多命令处理

(1)需求:

在某个目录下创建一个txt,在txt种加入一段文字

 

image.png

 

image.png

 

image.png

 

 
 
 
posted @ 2019-07-27 11:42  星辰戟  阅读(481)  评论(0编辑  收藏  举报