linux下对sh文件的操作

 

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

 

posted @ 2016-08-01 13:53  xitingxie  阅读(8901)  评论(0编辑  收藏  举报