linux shell

来源:互联网 发布:项目 书籍 商务 知乎 编辑:程序博客网 时间:2024/06/07 01:41

1.创建shell脚本

vi test.sh

并编辑

#!/bin/bashecho "hello,I will cd to home"cd 

“#!“ 是一个约定的标记,它告诉系统这个脚本需要什么解释器来执行,即使用哪一种 Shell。

echo 命令用于向窗口输出文本。
编辑完保存

2.运行

chmod +x ./test.sh #使其具有运行权限./test.sh          #运行脚本
0 0