Difference between revisions of "Talk: PINGUIN"

From Teknologisk videncenter
Jump to: navigation, search
m
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Hi, have a suggestion to some corrections. The program is not finished and fully tested. Do you have an idea how to test it?<br/>
+
Hi, have a suggestion to some corrections. <br/>
 +
I think you are doing wery good, and you design the program correcly. You only need to correct your syntax. Please look at the following correctins and compare it to your own.<br/>
 +
 
 +
The program is not finished and fully tested. Do you have an idea how to test it?<br/>
 
Remember that the pipe '''|''' is only used for sending '''STDOUT''' from one command to '''STDIN''' to the next command. as in
 
Remember that the pipe '''|''' is only used for sending '''STDOUT''' from one command to '''STDIN''' to the next command. as in
 
<source lang="bash">
 
<source lang="bash">
 
   find / | wc -l
 
   find / | wc -l
 
</source>
 
</source>
The following will fail, because
+
=== Suggestion, so far ===
 
<source lang="bash">
 
<source lang="bash">
 
#!/bin/bash
 
#!/bin/bash

Latest revision as of 05:26, 13 February 2009

Hi, have a suggestion to some corrections.
I think you are doing wery good, and you design the program correcly. You only need to correct your syntax. Please look at the following correctins and compare it to your own.

The program is not finished and fully tested. Do you have an idea how to test it?
Remember that the pipe | is only used for sending STDOUT from one command to STDIN to the next command. as in

  find / | wc -l

Suggestion, so far

#!/bin/bash
A=0

while test $K="yes"
do
  adresses="92.168.142.1 mars.tekkom.dk 172.16.4.77"
  for adress in $adresses
  do

    if ping -c 1 $adress >/dev/null
      then echo "Ping $adress  succeded."
      else
        echo "Ping $adress Failed."
        A=`expr $A + 1`
      fi
  done

  if test $A -ge 3
    then
      A=0
      write astifl ["3 times failed"]|
      echo ["3 times failed"] | mail -s "Ping Error" astifl
  fi

  sleep 60

done