Mailinglist Archive: opensuse (1486 mails)

< Previous Next >
Re: [opensuse] BASH: Shorter way to do [[ $line == QUIT ]] || [[ $line == Quit ]] || [[ $line == quit ]] && break ?
  • From: Michal Hrusecky <mhrusecky@xxxxxxx>
  • Date: Mon, 3 Aug 2009 15:00:39 +0200
  • Message-id: <20090803130039.GA15376@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Per Jessen - 8:59 29.07.09 wrote:
Duaine & Laura Hechler wrote:

Here is the simplest:

IF UPPER(LINE) = "QUIT" THEN EXIT/

/But this is in REXX


Which, given the subject, isn't applicable :-)

Rewritten to shell it would be something like

[ "`echo "$line" | tr [a-z] [A-Z]`" = "QUIT" ] && break

--
Michal Hrusecky

Package Maintainer
SUSE LINUX, s.r.o
e-mail: mhrusecky@xxxxxxx
< Previous Next >
Follow Ups