雑記/2014-10-22
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[雑記]]
#setlinebreak(on)
Ping を実行した際、Windows のように
「Request Timed out」を表示させる方法について書いてあるBl...
複製禁止でないことを祈りつつ貼り付ける。
host=*.*.*.*; max_cnt=10; cnt=1; while [ $cnt -le $max_cn...
*.*.*.*はIPアドレス [#iabdbaba]
max_cntは終了するカウント数
cntは開始するカウント数
RedHat系OSのBashで実際に打ってみた。
※Pukiwikiが改行されないため複数行で書いているが実際は一行...
[root@~]# host=172.16.254.254; max_cnt=10; cnt=1;
while [ $cnt -le $max_cnt ]; do rslt=`ping -w 1 -c 1 $h...
if [ $? -gt 0 ]; then echo -e "`date +'%H:%M:%S'` $host...
else echo "`date +'%H:%M:%S'` $host`echo $rslt | cut -d...
cnt=$(expr $cnt + 1); done;
15:44:02 172.16.254.254 icmp_seq=1 ttl=128 time=0.162 ms
15:44:03 172.16.254.254 icmp_seq=1 ttl=128 time=0.181 ms
15:44:04 172.16.254.254 icmp_seq=1 ttl=128 time=0.183 ms
15:44:05 172.16.254.254 icmp_seq=1 ttl=128 time=0.177 ms
15:44:06 172.16.254.254 icmp_seq=1 ttl=128 time=0.182 ms
15:44:07 172.16.254.254 icmp_seq=1 ttl=128 time=0.187 ms
15:44:08 172.16.254.254 icmp_seq=1 ttl=128 time=3.87 ms
15:44:09 172.16.254.254 icmp_seq=1 ttl=128 time=0.190 ms
15:44:10 172.16.254.254 icmp_seq=1 ttl=128 time=0.187 ms
15:44:11 172.16.254.254 icmp_seq=1 ttl=128 time=0.178 ms
[root@~]#
[root@~]# host=17.1.1.9; max_cnt=10; cnt=1;
while [ $cnt -le $max_cnt ]; do rslt=`ping -w 1 -c 1 $h...
if [ $? -gt 0 ]; then echo -e "`date +'%H:%M:%S'` $host...
else echo "`date +'%H:%M:%S'` $host`echo $rslt | cut -d...
cnt=$(expr $cnt + 1); done;
15:44:17 17.1.1.9 Request timed out.
15:44:18 17.1.1.9 Request timed out.
15:44:19 17.1.1.9 Request timed out.
15:44:20 17.1.1.9 Request timed out.
15:44:21 17.1.1.9 Request timed out.
15:44:22 17.1.1.9 Request timed out.
15:44:23 17.1.1.9 Request timed out.
15:44:24 17.1.1.9 Request timed out.
15:44:25 17.1.1.9 Request timed out.
15:44:26 17.1.1.9 Request timed out.
[root@~]#
終了行:
[[雑記]]
#setlinebreak(on)
Ping を実行した際、Windows のように
「Request Timed out」を表示させる方法について書いてあるBl...
複製禁止でないことを祈りつつ貼り付ける。
host=*.*.*.*; max_cnt=10; cnt=1; while [ $cnt -le $max_cn...
*.*.*.*はIPアドレス [#iabdbaba]
max_cntは終了するカウント数
cntは開始するカウント数
RedHat系OSのBashで実際に打ってみた。
※Pukiwikiが改行されないため複数行で書いているが実際は一行...
[root@~]# host=172.16.254.254; max_cnt=10; cnt=1;
while [ $cnt -le $max_cnt ]; do rslt=`ping -w 1 -c 1 $h...
if [ $? -gt 0 ]; then echo -e "`date +'%H:%M:%S'` $host...
else echo "`date +'%H:%M:%S'` $host`echo $rslt | cut -d...
cnt=$(expr $cnt + 1); done;
15:44:02 172.16.254.254 icmp_seq=1 ttl=128 time=0.162 ms
15:44:03 172.16.254.254 icmp_seq=1 ttl=128 time=0.181 ms
15:44:04 172.16.254.254 icmp_seq=1 ttl=128 time=0.183 ms
15:44:05 172.16.254.254 icmp_seq=1 ttl=128 time=0.177 ms
15:44:06 172.16.254.254 icmp_seq=1 ttl=128 time=0.182 ms
15:44:07 172.16.254.254 icmp_seq=1 ttl=128 time=0.187 ms
15:44:08 172.16.254.254 icmp_seq=1 ttl=128 time=3.87 ms
15:44:09 172.16.254.254 icmp_seq=1 ttl=128 time=0.190 ms
15:44:10 172.16.254.254 icmp_seq=1 ttl=128 time=0.187 ms
15:44:11 172.16.254.254 icmp_seq=1 ttl=128 time=0.178 ms
[root@~]#
[root@~]# host=17.1.1.9; max_cnt=10; cnt=1;
while [ $cnt -le $max_cnt ]; do rslt=`ping -w 1 -c 1 $h...
if [ $? -gt 0 ]; then echo -e "`date +'%H:%M:%S'` $host...
else echo "`date +'%H:%M:%S'` $host`echo $rslt | cut -d...
cnt=$(expr $cnt + 1); done;
15:44:17 17.1.1.9 Request timed out.
15:44:18 17.1.1.9 Request timed out.
15:44:19 17.1.1.9 Request timed out.
15:44:20 17.1.1.9 Request timed out.
15:44:21 17.1.1.9 Request timed out.
15:44:22 17.1.1.9 Request timed out.
15:44:23 17.1.1.9 Request timed out.
15:44:24 17.1.1.9 Request timed out.
15:44:25 17.1.1.9 Request timed out.
15:44:26 17.1.1.9 Request timed out.
[root@~]#
ページ名: