1、创建test.sh文件

touch test.sh

2、编辑sh文件

vi test.sh(i:插入 | esc:退出insert模式 | wq+回车:退出)

3、保存退出

敲击esc, 然后输入 :wq ,回车退出 

4、添加可执行权限,当然默认就是可执行的。

chmod +x test.sh

5、运行文件

(2)sh test.sh

rm test.sh

6 、sh中的注释:#

二 linux中echo命令的换行方法:

echo -e "text1\ntext2"

输出结果

 

text1

 

text2

 

相关文章:

  • 2022-12-23
  • 2021-07-13
  • 2021-12-06
  • 2021-12-25
  • 2021-07-23
  • 2021-12-06
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-12-06
  • 2021-12-06
  • 2022-12-23
  • 2021-12-01
相关资源
相似解决方案