From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1MoEAp-0007Z2-EY for garchives@archives.gentoo.org; Thu, 17 Sep 2009 10:25:11 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9A278E084A; Thu, 17 Sep 2009 10:25:10 +0000 (UTC) Received: from mail-iw0-f195.google.com (mail-iw0-f195.google.com [209.85.223.195]) by pigeon.gentoo.org (Postfix) with ESMTP id 86A75E084A for ; Thu, 17 Sep 2009 10:25:10 +0000 (UTC) Received: by iwn33 with SMTP id 33so178606iwn.3 for ; Thu, 17 Sep 2009 03:25:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=SxW8TxiANIMYwJKPrIN02Ly9MgSybc5IpDKPHncUIng=; b=N17NzrkcgDTBO0+mR7rrHK+NMD1DpGqQld0drjfGI6b7NvPaUr3Pnk5PNQf6y7JXMC 6eCHDh87YdUzrK3i1MAOeOop4TVFst5ljxDjjB9mjQaeIdWz+d4y8/t+1fHrNpiTcehh +dzbp5LKplSvUSnsy2W0/JBWk5zCGy9EYfyX0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PAVljIlWddJr00fWFPuRmhqtbIwjlRDQnLbbxZZPP2bQRJLQp3dhjCQHNBko4h34zn bZlVbanbK4LFd32rtu/8nscReN/Bz7T45rlPjR8LUUnhXxJG+gx6QcAro0k3P29tVNXn fNKTjeXCPkrjVy0R0ZptX73ajxzwOa9ttX2fs= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-amd64@lists.gentoo.org Reply-to: gentoo-amd64@lists.gentoo.org MIME-Version: 1.0 Received: by 10.231.73.131 with SMTP id q3mr20931555ibj.6.1253183110372; Thu, 17 Sep 2009 03:25:10 -0700 (PDT) In-Reply-To: <20090916222641.cca8e4da.frank.peters@comcast.net> References: <53e35fd50909160241l572edbe1hbdf065e6f661aaa6@mail.gmail.com> <1362ccfa0909160508r154ca46bn68ae907f8bf19e08@mail.gmail.com> <53e35fd50909160614u4c71489frbb05cf740a6ffa4@mail.gmail.com> <53e35fd50909160636l53ba14ffm6aa060f5f9648146@mail.gmail.com> <20090916122744.0d9707f7.frank.peters@comcast.net> <53e35fd50909161804n4067d10eqaf1d865a81300c5a@mail.gmail.com> <20090916222641.cca8e4da.frank.peters@comcast.net> Date: Thu, 17 Sep 2009 18:25:10 +0800 Message-ID: <53e35fd50909170325w4ea99561uec6dea2a5a2b1f47@mail.gmail.com> Subject: Re: [gentoo-amd64]corss compile 64bit on 32bit os From: Xi Shen To: gentoo-amd64@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 1374c8f7-ad42-4dcc-b2cd-8bfd51b27cbb X-Archives-Hash: 501a3ecf03a39bcdcfb655be390c5daa thanks, very helpful. On Thu, Sep 17, 2009 at 10:26 AM, Frank Peters w= rote: > On Thu, 17 Sep 2009 09:04:22 +0800 > Xi Shen wrote: > >> i searched for a while, but cannot find the reference of that syntax. >> thanks a lot. >> > > The ordinary syntax is ${string:position:length}, but in the ordinary cas= e > the position is referenced from the LEFT end of the string. =C2=A0To refe= rence > from the RIGHT end of the string, as in the Gentoo script, a negative val= ue > must be specified, but the negative value has to the result of an EXPRESS= ION, > hence the apparently unusual syntax. > > Why? =C2=A0See question E12 at this link: > http://www.faqs.org/faqs/unix-faq/shell/bash/ > > Just try it out. =C2=A0Copy the following two lines to a file, give the f= ile > executable permission, and create different symbolic links to it. > Then invoke the file using any of the symlinks. > > #! /bin/bash > echo ${0:$[-2]} > > > Frank Peters > > > --=20 Best Regards, David Shen http://twitter.com/davidshen84/ http://meme.yahoo.com/davidshen84/