Difference between revisions of "Talk: UNIX assignments"

From Teknologisk videncenter
Jump to: navigation, search
m (Answer)
Line 1: Line 1:
Could you give an advise - what's wrong with 14th line?
 
Program's name is "PINGUIN"
 
 
||||||program begins|||||
 
#!/bin/bash
 
K="yes"
 
A=0
 
 
  while test $K="yes"
 
  do
 
 
adresses="192.168.142.1 mars.tekkom.dk 172.16.4.77"
 
for adress in $adresses
 
  do
 
 
if ping -c $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"]|
 
  mail astifl ["3 times failed"]
 
fi
 
 
 
sleep 60
 
done
 
|||||end of program|||||
 
 
 
It's writing smth like this
 
Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]
 
            [-p pattern] [-s packetsize] [-t ttl] [-I interface or address]
 
            [-M mtu discovery hint] [-S sndbuf]
 
            [ -T timestamp option ] [ -Q tos ] [hop1 ...] destination
 
./PINGUIN: line 14: 0=1: command not found
 
ping: bad number of packets to transmit.
 
./PINGUIN: line 14: 0=1: command not found
 
Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]
 
            [-p pattern] [-s packetsize] [-t ttl] [-I interface or address]
 
            [-M mtu discovery hint] [-S sndbuf]
 
            [ -T timestamp option ] [ -Q tos ] [hop1 ...] destination
 
./PINGUIN: line 14: 0=1: command not found
 
  
 
== Answer ==
 
== Answer ==
Line 49: Line 4:
 
Will you please cut-and-paste a copy of your program on the Wiki.
 
Will you please cut-and-paste a copy of your program on the Wiki.
 
  :-) Henrik
 
  :-) Henrik
 +
 +
 +
== Tiedote ==
 +
It's made in WIKI on the name "PINGUIN" at the search... Thanks. ILja

Revision as of 20:04, 12 February 2009

Answer

Sorry but cant reach the server from home. (Problem on gateway) Will you please cut-and-paste a copy of your program on the Wiki.

:-) Henrik


Tiedote

It's made in WIKI on the name "PINGUIN" at the search... Thanks. ILja