From owner-freebsd-questions Wed May 30 1:51:37 2001 Delivered-To: freebsd-questions@freebsd.org Received: from relay2.ntu-kpi.kiev.ua (noc.ntu-kpi.kiev.ua [195.178.136.5]) by hub.freebsd.org (Postfix) with ESMTP id 0558037B422 for ; Wed, 30 May 2001 01:51:16 -0700 (PDT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from comsys.ntu-kpi.kiev.ua (eth0.comsys.ntu-kpi.kiev.ua [10.0.1.184]) by relay2.ntu-kpi.kiev.ua (Postfix) with ESMTP id 0E3F022E91; Wed, 30 May 2001 11:49:42 +0300 (EEST) Received: from pm5149 (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) by comsys.ntu-kpi.kiev.ua (8.11.3/8.11.3) with SMTP id f4U8hoP11190; Wed, 30 May 2001 11:43:50 +0300 (EEST) Message-ID: <018801c0e8db$ef8c3900$6d36120a@comsys.ntukpi.kiev.ua> From: "Andrey Simonenko" To: "Veaceslav Revutchi" Cc: References: <20010530113020.A74532@zeus.dnt.md> Subject: Re: ping result val. question Date: Wed, 30 May 2001 11:41:27 +0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG A return value of 127 means the execution of the shell failed. And I'm not sure that sh(1) can find ping(8) program. Check $PATH variable in the /etc/crontab file. ----- Original Message ----- From: Veaceslav Revutchi Newsgroups: lucky.freebsd.questions Sent: Wednesday, May 30, 2001 12:30 PM Subject: ping result val. question > Hi > > I am confused as to why I get different return values > to a ping if run o a command line vs crontab. > > Here is a small script: > > #!/bin/sh > ping -c 2 somehost.somedomain.com > /dev/null > echo $? >> /var/log/ping.log > > Now if I run it on command line I get a normal result code described > in the ping man page and sysexits.h. If I run it from crontab I get a > 127 res. val. no matter if the ping was succesful or not. > > Can someone explain this behaviour please. > thanks > slava To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message