日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

centos7编写shell批处理文件和执行方法

發(fā)布時(shí)間:2023/12/20 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 centos7编写shell批处理文件和执行方法 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

centos7編寫(xiě)shell批處理文件和執(zhí)行方法

cd /;

vi shownet.sh;

//shownet.sh批處理內(nèi)容如下:

#!/bin/bash ping -c 4 www.qq.com; ping -c 4 192.168.10.99; ping -c 4 192.168.20.11; ping -c 4 192.168.10.24; echo 'good';

執(zhí)行shell批處理文件方法:

./shownet.sh

報(bào)如下錯(cuò)誤處理方法:
cenos7.0 bash :permission denied

chmod 700 shownet.sh

然后再執(zhí)行批處理

./shownet.sh

[root@test /]# ./shownet.sh PING www.qq.com (182.140.167.44) 56(84) bytes of data. 64 bytes from 182.140.167.44 (182.140.167.44): icmp_seq=1 ttl=128 time=7.27 ms 64 bytes from 182.140.167.44 (182.140.167.44): icmp_seq=2 ttl=128 time=4.38 ms 64 bytes from 182.140.167.44 (182.140.167.44): icmp_seq=3 ttl=128 time=5.95 ms 64 bytes from 182.140.167.44 (182.140.167.44): icmp_seq=4 ttl=128 time=5.89 ms--- www.qq.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 4017ms rtt min/avg/max/mdev = 4.383/5.877/7.274/1.027 ms PING 192.168.10.99 (192.168.10.99) 56(84) bytes of data. 64 bytes from 192.168.10.99: icmp_seq=1 ttl=128 time=1.44 ms 64 bytes from 192.168.10.99: icmp_seq=2 ttl=128 time=2.49 ms 64 bytes from 192.168.10.99: icmp_seq=3 ttl=128 time=1.22 ms 64 bytes from 192.168.10.99: icmp_seq=4 ttl=128 time=2.19 ms--- 192.168.10.99 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3005ms rtt min/avg/max/mdev = 1.229/1.840/2.493/0.521 ms PING 192.168.20.11 (192.168.20.11) 56(84) bytes of data. 64 bytes from 192.168.20.11: icmp_seq=1 ttl=128 time=2.61 ms 64 bytes from 192.168.20.11: icmp_seq=2 ttl=128 time=2.02 ms 64 bytes from 192.168.20.11: icmp_seq=3 ttl=128 time=1.76 ms 64 bytes from 192.168.20.11: icmp_seq=4 ttl=128 time=1.97 ms--- 192.168.20.11 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3006ms rtt min/avg/max/mdev = 1.762/2.092/2.611/0.318 ms PING 192.168.10.24 (192.168.10.24) 56(84) bytes of data. 64 bytes from 192.168.10.24: icmp_seq=1 ttl=128 time=1.62 ms 64 bytes from 192.168.10.24: icmp_seq=2 ttl=128 time=1.10 ms 64 bytes from 192.168.10.24: icmp_seq=3 ttl=128 time=1.02 ms 64 bytes from 192.168.10.24: icmp_seq=4 ttl=128 time=1.01 ms--- 192.168.10.24 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3006ms rtt min/avg/max/mdev = 1.010/1.191/1.626/0.256 ms good

總結(jié)

以上是生活随笔為你收集整理的centos7编写shell批处理文件和执行方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。