← Back to team overview

sslug-teknik team mailing list archive

Re: NFS mount på trådløse maskiner

 

E. Sjørlund wrote:
...
> Hvad tester linjen
> 
> if [ $? == 0 ]

$? er status for udførslen af sidste kommando.

$ ping -c1 172.20.0.1
PING 172.20.0.1 (172.20.0.1) 56(84) bytes of data.
64 bytes from 172.20.0.1: icmp_seq=1 ttl=64 time=0.157 ms

--- 172.20.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.157/0.157/0.157/0.000 ms
$ echo $?
0


$ ping -c1 172.20.117.1
PING 172.20.117.1 (172.20.117.1) 56(84) bytes of data.
>From 172.20.2.11 icmp_seq=1 Destination Host Unreachable

--- 172.20.117.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

$ echo $?
1

Mogens

-- 
Mogens Kjaer, Carlsberg A/S, Computer Department
Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark
Phone: +45 33 27 53 25, Fax: +45 33 27 47 08
Email: mk@xxxxxx Homepage: http://www.crc.dk


References