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 1QMKTD-0007hl-BM for garchives@archives.gentoo.org; Tue, 17 May 2011 13:37:55 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 750891C0F1; Tue, 17 May 2011 13:36:29 +0000 (UTC) Received: from mx.virtyou.com (mx.virtyou.com [94.23.166.77]) by pigeon.gentoo.org (Postfix) with ESMTP id 3815B1C0F1 for ; Tue, 17 May 2011 13:36:29 +0000 (UTC) Received: from weird.localnet (p5B277910.dip.t-dialin.net [91.39.121.16]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx.virtyou.com (Postfix) with ESMTPSA id 4FB4A4A82BD for ; Tue, 17 May 2011 15:36:28 +0200 (CEST) From: Alex Schuster To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] is a nice "place" :-D Date: Tue, 17 May 2011 15:36:24 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.38-ck_edid; KDE/4.6.3; x86_64; ; ) References: <4DD1AEC8.5010501@earthlink.net> In-Reply-To: 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 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201105171536.26328.wonko@wonkology.org> X-Archives-Salt: X-Archives-Hash: d76f51c002a25e67e1fa743c9bad8af4 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 (or echo ${strarr[0]}) Wonko