shell脚本2待更新

第二天:
1.while循环,例
#!/bin/bash
i=1
sum=0
while [ i -lt 100 ]
do
((i++))
sum=$sum+$i
done
2.函数hello(){ echo "hello" }
调用函数:hello不需要括号
3.函数传递参数
hello(){echo "diyigecanshu$1"
echo "第二个参数$2"}
hello 1 100 打印结果diyigecanshu1 第二个参数100
4.函数给返回值:
5.判断文件或者目录存不在 -d "$a"代表(-d,存在时为true,不存在时为false)目录是否存在;判断文件是否存在-f "$a"

6.linux中自动部署oracle
1)echo $USER打印出当前的用户$USER代表当前用户,

原文地址:https://www.cnblogs.com/zhaobobo10/p/12148427.html