From owner-freebsd-questions@FreeBSD.ORG Mon Jun 22 00:57:30 2015 Return-Path: Delivered-To: freebsd-questions@nevdull.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 494A3809 for ; Mon, 22 Jun 2015 00:57:30 +0000 (UTC) (envelope-from listmgr@antennex.com) Received: from BAY004-OMC2S16.hotmail.com (bay004-omc2s16.hotmail.com [65.54.190.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31F6C784 for ; Mon, 22 Jun 2015 00:57:29 +0000 (UTC) (envelope-from listmgr@antennex.com) Received: from BAY404-EAS428 ([65.54.190.123]) by BAY004-OMC2S16.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Sun, 21 Jun 2015 14:36:40 -0700 X-TMN: [QAGb9LttYosAVlsluFqKwql5UxbUL60KOX958lrqwQE=] X-Originating-Email: [listmgr@antennex.com] Message-ID: From: "Lt. Commander" To: "'Lt. Commander'" , "'Patrick Hess'" , References: <20150615015516.b3ea7633.freebsd@edvax.de> <2609852.Pc7nSdcYla@desk8.phess.net> In-Reply-To: Subject: RE: Script question Date: Sun, 21 Jun 2015 16:36:36 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQABAgME0X1Dm5rl1ITbGRHvuqm5ZwDmqqb4AImG+awAOb+0/QChWiN0ACr4FWoAANHiZwBu370yAH5eu84A9Ixn/QACGnsroTP4aEA= Content-Language: en-us X-OriginalArrivalTime: 21 Jun 2015 21:36:40.0914 (UTC) FILETIME=[5C521B20:01D0AC6A] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2015 00:57:30 -0000 Sheesh! Here's the script: #get_yes_no() { while true do echo -n "$1 (Y/N) ? " read -t 30 a if [ $? != 0 ]; then a="No"; return; fi case $a in [Yy]) a="Yes"; return;; [Nn]) a="No"; return;; *);; esac done #} get_yes_no "Do you want to continue......" [ $a = 'No' ] && exit 1 ______________________________________________ Hi list! The script guys were very helpful in smoothing out my sh shell script and it with other script calls are doing the job I needed. BUT! I took the snippet below to use as an "yes/no" intro to one of the calls. It must have aged as is because it complains about badly placed "()s" right near the top of the intro and I suspect it won't agree with another line further down either. Perhaps a hint from the experts as to how to change the problem? Thank you! Jason