shell脚本
1.创建脚本
[root@centos01 ~]# vim ./text.sh
2.执行脚本
[root@centos01 ~]# sh ./text.sh
管道符
查看全部端口
[root@centos01 ~]# netstat -anptu
管道符过滤只查看sshd端口
[root@centos01 ~]# netstat -anptu | grep sshd
重定向
1.重定向追加输出到1.txt
[root@centos01 ~]# echo ‘hello’ >> ./1.txt
2.错误追加输出
[root@centos01 ~]# aa 2>> ./error.log
环境变量
1.定义环境变量名字a、b
[root@centos01 ~]# a=benet
[root@centos01 ~]# b=accp
2.调用环境变量
3.允许调用变量
4.不允许调用变量
5.命令执行结果赋值给变量名
6.read -p应用
7.防止变量的字符混淆
8.定义全局环境变量
8.整数运算
运算符:+、-、*、/、%
9.位置变量
10.预定义变量