From owner-freebsd-questions Thu Jan 4 16:56:55 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA04296 for questions-outgoing; Thu, 4 Jan 1996 16:56:55 -0800 (PST) Received: from bambi.pomona.edu (bambi.pomona.edu [134.173.64.3]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id QAA04290 for ; Thu, 4 Jan 1996 16:56:52 -0800 (PST) Received: from POMONA.EDU by POMONA.EDU (PMDF V5.0-4 #12356) id <01HZMBAKK0A88WWXUO@POMONA.EDU> for questions@freebsd.org; Thu, 04 Jan 1996 16:56:45 -0800 (PST) Date: Thu, 04 Jan 1996 16:56:45 -0800 (PST) From: JOHN Subject: Some BASH Shell programming questions. To: questions@freebsd.org Message-id: <01HZMBAKK3428WWXUO@POMONA.EDU> X-VMS-To: IN%"questions@freebsd.org" MIME-version: 1.0 Content-type: TEXT/PLAIN; CHARSET=US-ASCII Content-transfer-encoding: 7BIT Sender: owner-questions@freebsd.org Precedence: bulk Hi everyone - I just have some quick questions about bash shell scripts. I'm writing a simple menu system for a friend who wants to use my system. First, can I write functions within a bash shell? Right now I have a main menu which calls a different script fro each additional menu. This I suppose can take up processor time since it spawns a bash shell for each. SO - can I have functions, one for each menu, in a single shell script. (Im sure I can, just dont know how) 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? Third, this is probably also REALLY simple, but I'm a beginner. I am putting a prompt for each menu, as such: Command > _ 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 >_ ? I know that this would probably be better sent to a newsgroup on shell programming, but I don't have usenet access right now. Thanks everyone!