Register
It is currently Wed Apr 16, 2014 4:39 am

Trouble casting an array using 2 variables to name them.


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Thu Jan 07, 2010 1:12 pm   

Joined: Thu Jan 07, 2010 12:44 pm
Posts: 1
I am writing a fairly large script and am nearly finished. Of course, right at the end, a show stopper..
I am attempting to cast a dynamic array, which I can do all day. But this is the first time I have every tried to cast an array using two variables in the name.
I have put an example below..

RUNTIME_[$i]_[$j]="`/proc/cpuinfo` | grep \"Total time:\" | awk {'print $3'}`"

Thanks,

Joshua


Top
 Profile  
 PostPosted: Mon Jan 11, 2010 1:14 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 511
this does not an array!
this does:
Code:
array=( foo bar baz )
please note braces.

about using variables in variables'name, `help eval`, maybe


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 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