From owner-freebsd-questions Thu Jan 4 19:24:31 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA26987 for questions-outgoing; Thu, 4 Jan 1996 19:24:31 -0800 (PST) Received: from virginia.edu (uvaarpa.Virginia.EDU [128.143.2.7]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id TAA26976 for ; Thu, 4 Jan 1996 19:24:24 -0800 (PST) Received: from archive.cs.virginia.edu by uvaarpa.virginia.edu id aa19832; 4 Jan 96 22:24 EST Received: from stretch.cs.Virginia.edu (atf3r@stretch-fo.cs.Virginia.EDU [128.143.136.14]) by archive.cs.Virginia.EDU (8.7.1/8.6.6) with SMTP id WAA01610; Thu, 4 Jan 1996 22:24:22 -0500 (EST) Received: by stretch.cs.Virginia.edu (4.1/SMI-2.0) id AA26039; Thu, 4 Jan 96 22:24:19 EST Date: Thu, 4 Jan 1996 22:24:19 -0500 (EST) From: "Adrian T. Filipi-Martin" Reply-To: adrian@virginia.edu To: JOHN Cc: questions@freebsd.org Subject: Re: Some BASH Shell programming questions. In-Reply-To: <01HZMBAKK3428WWXUO@POMONA.EDU> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org Precedence: bulk Of course, you should read the man page. O'Reilly has a pretty good book on bash as well. Here are a few examples of what you want to look for. Adrian On Thu, 4 Jan 1996, JOHN wrote: > First, can I write functions within a bash shell? Right now I have a main menu Yes. e.g. function: function SayFoo { echo "Foo" return 0 } If you are doing menus, you should also consider using the 'select' command. It is designed to make menus simple to code up and maintain. > Second, is it possible to capture ^C and such so that a person can't exit out > of the menu, or if they could, that at least it would output a message telling > them how to get back to the menu? Check out the 'trap' command. You can look at /etc/rc for some examples of its use. > But the cursor is always where the '_" is here, since I use the echo command. > Is there a way to keep the cursor right after the Command >_ ? echo -n "Command >" adrian@virginia.edu ---->>>>| Support your local programmer, http://www.cs.virginia.edu/~atf3r/ --->>>| STOP Software Patent Abuses NOW! Member: The League for -->>| For an application and information Programming Freedom ->| see: http://www.lpf.org/