十五. 第一个shell script 脚本程序

来源:互联网 发布:mac怎么删除双系统 编辑:程序博客网 时间:2024/05/17 07:31
1.  可以使用任何文本编辑工具编写,如: vim
     #!/bin/bash #放置在文件的开头

2.  设置脚本执行权限:
chmod  a+x  filename      所有用户可执行
chmod  700  filename     可执行权限

3.  执行脚本的三种方式:
     bash your_script.sh
     sh your_script.sh
     ./your_script.sh

4.  示例:vim  hello.sh   

#!/bin/bash
echo "hello world!"

         
0 0
原创粉丝点击