[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Edlug Archive Nov 2009 ]

Re: [edlug] Shell Script Problem




Hi Rab



Robert McLay wrote:
Which I would like to compress into a single line to clarify the
script. How would I achieve this...?
It looks like this might be a multi option type menu, if it is you might want to change to a case statement as that's much neater (and you'd be able to get the options down to a single line each). Something like this (from my current coursework):

case "$INPUT" in
   "1" )  backupMenu ;;
   "2" )  restoreMenu ;;
   "3" )  exit ;;
esac

More here: http://tldp.org/LDP/abs/html/testbranch.html#EX30

I'm trying to figure out Bash properly (like using functions and stuff) at the moment. It's not pretty.

Al
-
----------------------------------------------------------------------
You can find the EdLUG mailing list FAQ list at:
http://www.edlug.org.uk/list_faq.html



This archive is kept by wibble+RM@xxx.xxx.xxx
Morpheux
HomePage