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 1QMKhy-0000kF-Eu for garchives@archives.gentoo.org; Tue, 17 May 2011 13:53:10 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6D6321C0EA; Tue, 17 May 2011 13:51:46 +0000 (UTC) Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com [209.85.210.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 227EC1C0EA for ; Tue, 17 May 2011 13:51:45 +0000 (UTC) Received: by pzk6 with SMTP id 6so347764pzk.40 for ; Tue, 17 May 2011 06:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=eEoUeYS6r78lH8bfiuDQf+8aZFLPELP594iyWa5d7+8=; b=AHFeEUb2j1Qd9x8r5/wzkPeVOMedUaxayHlMyVRcCrSahoD2OJX/ul4U4ZPymcb6lR trmttLiYkxUrwMEwBVIpUP+up3Gy1HA/i7O/N8mfwrfXPXk1hrSFPKI1b7sNxTpLfMeu dOKH3G+5ReC4ueciYtpKIS5IvVfAJUj0DxmLM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=NJs2DsOS2HcTykGWhnY18baR0mEFtHFLBlmMt2eZ3SkXOYY8RduX9DmhhVysco/lbe eIrPg32RpYEHrMb4p1V/ZlP9mu1UAjuUx8blmI2YTROV2VF1BMXgwYhmKymUurSjDv45 vAc3bnqL5ZGiM9ljjKeTRNW3VK6+oMNe2DNNI= Received: by 10.68.30.74 with SMTP id q10mr1107924pbh.110.1305640305077; Tue, 17 May 2011 06:51:45 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.68.65.168 with HTTP; Tue, 17 May 2011 06:51:25 -0700 (PDT) In-Reply-To: <201105171536.26328.wonko@wonkology.org> References: <4DD1AEC8.5010501@earthlink.net> <201105171536.26328.wonko@wonkology.org> From: =?UTF-8?Q?Juan_Diego_Tasc=C3=B3n?= Date: Tue, 17 May 2011 08:51:25 -0500 Message-ID: Subject: Re: [gentoo-user] is a nice "place" :-D To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: fedfd932ccc6a307ee316c7ffe91e48d On Tue, May 17, 2011 at 8:36 AM, Alex Schuster wrote: > Juan Diego Tasc=C3=B3n writes: > >> I have always wondered if there is a way to do awk '{ print $1}' using >> only builtin bash functions when you only have a one line string > > str=3D"one two five" > > # remove all from the first blank on, but will not work with > # other whitespace > echo ${str%% *} > > or > > # set $1, $2, $3, ... to words of $str > set $str > echo $1 > > or > > # create array holding one word per element > strarr=3D( $str ) > echo $strarr =C2=A0(or echo ${strarr[0]}) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0Wonko > > thanks for the info