On Tuesday 28 July 2009 11:23:38 am Per Jessen wrote:
David C. Rankin wrote:
Bash gurus,
What is a shorter way to do multiple case insensitive tests on a string or variable that would accomplish this:
[[ $line == QUIT ]] || [[ $line == Quit ]] || [[ $line == quit ]] && [[ break
You could translate $line to upper or lower case first (using tr), then do your tests.
/Per
Anders, Randall, Per, Thanks. As in Anders and Pers responses, the translate to upper/lower before testing is the bit that hadn't flipped in my mind. Makes it a lot easier, thanks again. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org