public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Roy Marples <uberlord@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev]  Re: [gentoo-commits] gentoo-x86 commit in x11-libs/qt: ChangeLog qt-4.3.2.ebuild
Date: Thu, 04 Oct 2007 07:49:04 +0100	[thread overview]
Message-ID: <1191480544.2542.5.camel@uberpc.marples.name> (raw)
In-Reply-To: <fe1oge$140$1@sea.gmane.org>

On Thu, 2007-10-04 at 05:03 +0100, Steve Long wrote:
> Donnie Berkholz wrote:
> 
> > spec=$(echo ${CHOST} | cut -d- -f3)
> > 
> You can do this without resort to an external process:
> IFS=-
> read _ _ spec _ <<< "$CHOST"
> unset IFS
> - or you can do:
> IFS=-
> arr=($CHOST)
> unset IFS
> spec=${arr[2]}

See, another use of bash arrays just because you can?
IFS=-
set -- ${CHOST}
spec=$2

Works fine in bash - and other shells.

You need to preserve IFS when changing it, however. Unless of course,
you're doing this in a function so you can just local IFS=-

Here's a snippet from b2's localmount init script.

IFS=${IFS} SIFS=${IFS-y}
FS=$IFS:
for x in ${NO_UMOUNTS} ${RC_NO_UMOUNTS} ; do
   no_umounts="${no_umounts}|${x}"
one
if [ "${SIFS}" = "y" ] ; then
   IFS=$OIFS
else
   unset IFS
fi

Thanks

Roy

-- 
gentoo-dev@gentoo.org mailing list



  reply	other threads:[~2007-10-04  7:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1Id5gB-0006KU-HS@stork.gentoo.org>
2007-10-03 17:38 ` [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in x11-libs/qt: ChangeLog qt-4.3.2.ebuild Donnie Berkholz
2007-10-03 18:05   ` Caleb Tennis
2007-10-04  4:03   ` Steve Long
2007-10-04  6:49     ` Roy Marples [this message]
2007-10-04  7:32       ` Donnie Berkholz
2007-10-04  7:43         ` Roy Marples
2007-10-04  9:53       ` Marijn Schouten (hkBst)
2007-10-04 10:11         ` Roy Marples
2007-10-05 12:34       ` [gentoo-dev] " Steve Long
2007-10-05 17:50         ` Donnie Berkholz
2007-10-05 23:41           ` [gentoo-dev] " Steve Long
2007-10-06  0:06             ` Donnie Berkholz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1191480544.2542.5.camel@uberpc.marples.name \
    --to=uberlord@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox