Register
It is currently Fri Jul 25, 2014 7:46 am

More Variable problems!


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Mon Apr 11, 2011 5:40 am   

Joined: Sun Apr 03, 2011 5:58 am
Posts: 7
Hello,

Wanna do something like this:

Code:
var=bar
foo_$var=hello

echo $foo_bar


Output should be: hello

Any Ideas?


Top
 Profile  
 PostPosted: Mon Apr 11, 2011 6:56 am   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 532
Hi,

use declare builtin
Code:
var=bar
declare foo_$var=hello

echo $foo_bar


Top
 Profile  
 PostPosted: Mon Apr 11, 2011 8:57 am   

Joined: Sun Apr 03, 2011 5:58 am
Posts: 7
Thanks!


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP