From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Largent Subject: Re: bash arithmetic Date: Thu, 27 Feb 2003 09:35:08 -0500 Sender: linux-admin-owner@vger.kernel.org Message-ID: <3E5E221C.9050200@imagelinks.com> References: <20030227100040.GE2148@fede2.tumsan.fi> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20030227100040.GE2148@fede2.tumsan.fi> List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: linux-admin Try it this way, NAME=john echo name is $NAME echo now im gonna $NAME=$(($NAME+1)) eval ${NAME}=$(($NAME+1)) echo "john = $john" urgrue wrote: > simple problem: > NAME=john > echo name is $NAME > echo now im gonna $NAME=$(($NAME+1)) > $NAME=$(($NAME+1)) > > returns: > name is john > now im gonna john=1 > ./testscript: john=1: command not found > > but whats wrong with john=1? i want to set that variable. i can put > john=1 in the script (in that form) and it works fine. > any suggestions? > - > To unsubscribe from this list: send the line "unsubscribe linux-admin" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > -- Jeff Largent ImageLinks, Inc. Sr System Admin Melbourne, Fl 32935 (321) 253-0011 fax: (321) 253-5559