十五. 第一个shell script 脚本程序
2016-06-01 10:48
288 查看
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!"
#!/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!"
相关文章推荐
- 十四. bash shell的操作环境
- 在linux shell脚本中root切换到普通用户执行脚本或命令
- 重新启动gnome-shell
- 十三. shell变量键盘读取,数组与声明:read, array, declare
- shell awk统计重复个数
- Shell小知识date和seq
- 十一. shell的变量功能之变量的显示与设置,取消:echo,unset
- 十. Linux中bash shell的使用
- 2 cat 命令
- Powershell 通过BING 搜索
- 一天一个shell命令 文本操作系列-comm命令用法
- bash shell 启动方式
- shell之tr
- Win7下常用shell命令解析
- Win7下常用shell命令解析
- shell中$(( ))与$( )还有${ }的区别
- [Shell学习笔记]字符串操作
- 根据提供的文件名文本,查找指定目录下的该文件,找到后复制到指定文件夹--bash
- Powershell
- xshell项目服务器命令