开始Shell编程
2016-01-14 09:39
691 查看
开始Shell编程
NT:如无特别说明,下面使用bash shell。编写脚本只需以下几步:
(1) 打开编辑器,写下脚本。
(2) 给保存的脚本执行权限。
使用
chmod permission your-script-name,如:
$ chmod +x your-script-name $ chmod 755 your-script-name
(3) 执行脚本。
$ bash script $ sh script $ ./script
NT:
./表示当前目录,
.表示用当前shell执行给出的脚本。
$ . script
写下第一个脚本:
$ vim first # first shell script # clear echo "Hello, Furzoom"
保存后,按照上面的步骤添加执行权限并执行脚本。
$ chmod 755 first.sh $ ./first.sh
清除屏幕后,显示
Hello, Furzoom。
其中
#表示该行为注释,
clear表示清除屏幕,
echo将信息输出到屏幕。
本系列目录及相关代码。
相关文章推荐
- HBase shell查询
- Linux Shell 基础
- Linux Shell Script目录
- shell脚本编程之数组
- shell脚本编程之循环语句
- shell脚本编程之判断语句
- Week 1 solved question: change environment by shell
- shell脚本ping -w用法
- Shell脚本编程之判断语句
- shell脚本编程之循环语句
- shell脚本编程之数组
- shell split 字符串 三种方式和效率
- shell 参数列表
- 《Linux命令、编辑器与Shell编程》读书笔记12-函数和脚本
- linux shell 札记
- badusb_nc反弹shell
- Azure PowerShell 和 Visual Studio 不同版本下载安装
- linux shell学习笔记(一)——光标移动、输出、函数、循环
- jmeter beanshell内容
- &&在shell