If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Dynamic variables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-03, 07:20
rnavanee rnavanee is offline
Registered User
 
Join Date: Jul 2003
Location: Chennai
Posts: 11
Question Dynamic variables

I am reposting ..
months1="Jan"

i=1
a=`echo months$i`
a=`eval $a`
echo $a

I want to get the value "Jan". How can i do this?


-- Navanee
Reply With Quote
  #2 (permalink)  
Old 07-21-03, 08:16
pooja pooja is offline
Registered User
 
Join Date: Dec 2002
Posts: 104
Re: Dynamic variables

Quote:
Originally posted by rnavanee
I am reposting ..
months1="Jan"

i=1
a=`echo months$i`
a=`eval $a`
echo $a

I want to get the value "Jan". How can i do this?


-- Navanee
months1='jan'
i=1
eval eval echo \\$\months$i

hope this will help,
Pooja
Reply With Quote
  #3 (permalink)  
Old 07-21-03, 09:50
rnavanee rnavanee is offline
Registered User
 
Join Date: Jul 2003
Location: Chennai
Posts: 11
Talking

Pooja,
Thank you this is working fine!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On