From: Jeff Largent <jlargent@imagelinks.com>
To: linux-admin <linux-admin@vger.kernel.org>
Subject: Re: bash arithmetic
Date: Thu, 27 Feb 2003 09:35:08 -0500 [thread overview]
Message-ID: <3E5E221C.9050200@imagelinks.com> (raw)
In-Reply-To: <20030227100040.GE2148@fede2.tumsan.fi>
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
prev parent reply other threads:[~2003-02-27 14:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-27 10:00 bash arithmetic urgrue
2003-02-27 10:22 ` Carl
2003-02-27 14:35 ` Jeff Largent [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E5E221C.9050200@imagelinks.com \
--to=jlargent@imagelinks.com \
--cc=linux-admin@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).