Day4:学习shell script
来源:互联网 发布:软件错误代码c0000005 编辑:程序博客网 时间:2024/05/22 14:33
学习笔记:
1. 写shell script---vi 执行--sh
2.script执行方式的区别
如果是直接使用sh 执行,那么实际上是在子进程中执行的,那么在脚本中需要加入PATH环境变量
如果是使用source,那么是在父进程中执行的。
3.用test 配合逻辑符号来进行测试
4.也可以用[]来作判断例如[ $HOME = = $MAIL ],注意空格就可以了
5.条件判断式:
5.1(cpp中的if )
if...then
fi --结束if 的意思
5.2(cpp中的switch-case)
case $变量名称 in
"变量内容1")
..................
"变量内容2")
..................
"变量内容3")
..................
esac --结束5.3(cpp中的函数)
function()
{
}
6.循环
6.1
while[条件]
do
......
done --结束
6.2
until[条件]
do
......
done --结束
6.3for var in con1 con2 con3
do
......
done
6.3
for ((初始值;限制值;执行步长))
do
......
done
好熟悉.........
7.shell script的追踪和调试
阅读全文
1 0
- Day4:学习shell script
- Shell Script 的学习
- 学习Shell script
- shell script学习备忘
- 学习shell script
- 学习 shell script
- Shell Script 学习整理
- shell script 学习
- 学习shell script
- Linux shell script学习
- 学习shell script
- shell script 学习记录
- Shell Script 学习笔记
- 学习shell script
- 学习shell script
- shell script学习
- Linux的Shell Script学习
- shell script学习笔记1
- 给一个分数求小数点后第n位是多少
- Spark Runtime解密
- 军事机密
- MATLAB画圆
- 简单的springMvc用myeclipse使用流程第一篇
- Day4:学习shell script
- 4、线程同步通信
- Fibonacci(Java)
- C++11 基于范围的for循环
- 【Python】3“字符串和编码“
- 重构数据库分析
- 数据库中Schema(模式)概念的解说
- 操作系统资源汇总
- 用TensorFlow构造CNN进行手写数字识别