CodePudding user response:
The file name of the student's name to manually inputCodePudding user response:
#!/bin/bashThe DATE=` DATE 'm. y. + % % % d' `
Echo $DATE
Read -p "input the student's name" name1
Wj=/$name1 $DATE - up. TXT
Wj1=/$name1 $DATE - the TXT
Touch $wj & amp; & Touch $wj1
The read - p "please enter a network segment to test cases (192.168.16)!" Ipa
For I in {1.. 255}
Do
Ping - c1 - I 0.1 - w1 $ipa. $I & amp;>/dev/null
If [$?=0]; Then
Echo $ipa. $I "up" & gt;> $wj
The else
Echo $ipa. $I "down" & gt;> $wj1
Fi
The done
Echo "connection is successful results in $wj
Failure in $wj1
"