摘要: shell ping ip或者域名是否存在 ip=gc-server if ping -c 1 $ip > /dev/null; then echo "$ip Ping is successful." else echo "$ip Ping is failure" fi 阅读全文
posted @ 2020-12-16 16:34 cchilei 阅读(86) 评论(0) 推荐(0) 编辑
摘要: ###1.使用grep s1="helloworld" s2="ello" result=$(echo $s1 | grep "${s2}") if [[ "$result" != "" ]] then echo "$s1 include $s2" else echo "$1 not include 阅读全文
posted @ 2020-12-16 10:54 cchilei 阅读(1132) 评论(0) 推荐(0) 编辑