From owner-freebsd-questions@FreeBSD.ORG Mon Nov 5 07:03:47 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6116D16A417 for ; Mon, 5 Nov 2007 07:03:47 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) by mx1.freebsd.org (Postfix) with ESMTP id 93AEF13C4A3 for ; Mon, 5 Nov 2007 07:03:45 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from banyan.cs.ait.ac.th (banyan.cs.ait.ac.th [192.41.170.5]) by mail.cs.ait.ac.th (8.13.1/8.12.11) with ESMTP id lA573Vgl086833 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 5 Nov 2007 14:03:31 +0700 (ICT) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.13.6/8.12.11) id lA573V3q013117; Mon, 5 Nov 2007 14:03:31 +0700 (ICT) Date: Mon, 5 Nov 2007 14:03:31 +0700 (ICT) Message-Id: <200711050703.lA573V3q013117@banyan.cs.ait.ac.th> From: Olivier Nicole To: freebsd-questions@freebsd.org X-Virus-Scanned: on CSIM by amavisd-milter (http://www.amavis.org/) Subject: How to write a condition in Bourne shell X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2007 07:03:47 -0000 Hi, I am a lame Bourne sheel programmer, how to write: while [ ( $? -ne 0 ) -a ( $retry -gt 0 ) ] ; do that should execute as long as $? is not null and $retry is greater than 0? TIA, Olivier