From owner-freebsd-questions Tue Mar 14 13:34:44 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail.telestream.com (mail.telestream.com [205.238.4.5]) by hub.freebsd.org (Postfix) with ESMTP id 2C83C37B6EB for ; Tue, 14 Mar 2000 13:34:30 -0800 (PST) (envelope-from keith@mail.telestream.com) Received: from localhost (keith@localhost) by mail.telestream.com (8.9.3/8.9.3) with ESMTP id NAA31250; Tue, 14 Mar 2000 13:34:13 -0800 Date: Tue, 14 Mar 2000 13:34:12 -0800 (PST) From: To: Dan Nelson Cc: freebsd-questions@FreeBSD.ORG Subject: Re: silly off topic scripting question In-Reply-To: <20000314144600.A97517@dan.emsphone.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Didn't work like you suggested but it sparked me to think of a way that did. So thanks. Here is how I did it. for instance in $LIST do NEWDATA=${NAME[17]} < This is an array index that is the dynamic portion. PREVDATA=$TOTAL TOTAL=$PREVDATA:$NEWDATA done echo $TOTAL Keith ================================= I here by change the name of RedHat to RedSplat. Keith W. At the helm ================================= On Tue, 14 Mar 2000, Dan Nelson wrote: > In the last episode (Mar 14), keith@mail.telestream.com said: > > How can one append a variable in BASH? Like run a loop and have the > > results of the loop append a variable instead of just resetting the > > variable with the new result? > > I have the bash book and don't seem to see this discussed anywhere. > > $ newdata=hello > $ var=test > $ var=$var$newdata > $ echo $var > > testhello > $ > > -- > Dan Nelson > dnelson@emsphone.com > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message