20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析

20.16/20.17 shell中的函数
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
显示变量的隐函数
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
执行的结果
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
参数只有一个1,执行的结果 第一个是1,第二个是空的,第三个也是空的,肢本的名字是fun1.sh,总共有1个参数
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
加法的函数
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
显示IP的隐函数
-A1是显示关键词的一行包括下一行
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
精准查找到IP
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
脚本就可以这样写,ip $eth 是输入一个网卡的名字
#!/bin/bash
ip()
{
ifconfig |grep -A1 "ens33: " |awk '/inet/ {print $2}'
}
read -p "Please input the eth name: " eth
ip $eth
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
执行结果
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
当输入ens37没有值,这时候就需要判断了,有2个判断,一个是输入的网卡是不是系统里的网上,别一个是,当输入的网上没有值
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.18 shell中的数组
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
查看数组的某一个值
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
可以更改元素的值
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析
20.16/20.17 shell中的函数20.18 shell中的数组20.19 告警系统需求分析

转载于:https://blog.51cto.com/13450039/2105988

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值