Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Jan 1996 16:56:45 -0800 (PST)
From:      JOHN <JSINNOTT@POMONA.EDU>
To:        questions@freebsd.org
Subject:   Some BASH Shell programming questions.
Message-ID:  <01HZMBAKK3428WWXUO@POMONA.EDU>

next in thread | raw e-mail | index | archive | help
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!




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01HZMBAKK3428WWXUO>