John Lange wrote:
This doesn't really answer your question but skimming your email I assume you are trying to process command line options in bash scripts and so I'm wondering if you have considered using getopt or getopts to process your command line options instead?
getopt is actually the older and "less good" way to do things but it's the one I use because I'm more familiar with it. The code below is a "getopt" example but if you google for "bash getopt" you will find much better examples of both getopt and getopts.
Thanks for the examples John. Yes, I've used getopt and for dealing with more parameters I would, but for little short scripts I generally just do the handling with case or a few ifs or tests. This thread started that way with me just trying to shorten the command line parsing to a couple of lines like: [[ test ]] || (do this; do that) the parenthesis were screwing me my doing this and that in a sub-shell. What I needed and what I had tried to do was: [[ test ]] || {do this; do that;} but when I did it, I had forgotten to put in the trailing semi-colon after the last command.. That is where the learning needed to occur, and thankfully, it did ;-) -- David C. Rankin, J.D.,P.E. | Rankin Law Firm, PLLC | Countdown for openSuSE 11.1 510 Ochiltree Street | http://counter.opensuse.org/11.1/small Nacogdoches, Texas 75961 | Telephone: (936) 715-9333 | openSoftware und SystemEntwicklung Facsimile: (936) 715-9339 | http://www.opensuse.org/ www.rankinlawfirm.com | -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org