Mailinglist Archive: opensuse-factory (883 mails)

< Previous Next >
Re: grep, cut, and all that (Re: [opensuse-factory] Status: Beta)
  • From: Claudio Freire <klaussfreire@xxxxxxxxx>
  • Date: Tue, 29 May 2012 16:48:14 -0300
  • Message-id: <CAGTBQpZ2UsAZWFe5ahJvOjCdguHt7-SVUZcmsJ_L4+3VeDfn=g@mail.gmail.com>
On Tue, May 29, 2012 at 4:44 PM, Brian K. White <brian@xxxxxxxxx> wrote:
You don't need awk or anything but the same shell that's already executing
the script.

GetVal () {
       DONE=false
       until $DONE ; do
               IFS=: read KEY VAL junk || DONE=:
                       [[ "$KEY" == "$1" ]] && { echo $VAL ; DONE=: ; }
       done < $2
}

Isn't that bash-specific? Don't spec scripts have to be more generic
(sh-compatible)?
--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >