[Nolug] Bash question

From: David John <djohn_at_archdiocese-no.org>
Date: Fri, 20 Apr 2007 10:40:35 -0500
Message-ID: <00b501c78362$3d2ea810$b78bf830$@org>

Hello list,

 

In a Bash script, I have something like so:

 

VAR="$1"

CONNECT=0

        for i in {A..$VAR}

        do

                ((CONNECT++))

        done

 

I call the script like so:

./script.sh C

 

The above spits out 1 regardless of what letter I use.

My question is, how do I use a variable inside of a brace expansion?

If I simply did “for I in {A..C} …etc” $CONNECT would equal 3.

 

Thanks.

 

Dave

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.5.5/769 - Release Date: 4/19/2007
5:56 PM
 
This message has been scanned by the Internet Service Departments Virus/Spam filter.
___________________
Nolug mailing list
nolug@nolug.org
Received on 04/20/07

This archive was generated by hypermail 2.2.0 : 12/19/08 EST