Register
It is currently Sun Apr 20, 2014 9:38 pm

Third times a charm!


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Mon Apr 18, 2011 12:51 pm   

Joined: Sun Apr 03, 2011 5:58 am
Posts: 7
Code:
#!/bin/bash

VAR=hej
VAR2=lol
VAR3=hej
VAR4=hej
declare hej$VAR=$VAR2

echo $hejhej   #=lol This works fine

ans=`eval echo ${!VAR3}${!VAR4}`

echo $ans


Yes, more variable problems!

I Wanna use VAR3 and VAR4 to echo hej$VAR. Could it be done?

I'm going nuts here :D

//Barty


Top
 Profile  
 PostPosted: Thu Apr 21, 2011 4:11 pm   
User avatar

Joined: Tue Apr 27, 2010 2:28 pm
Posts: 172
Location: Czech Republic
I do not understand your specification. What is the desired output? If you want the string "VAR" to appear in it, you are in a trouble: it is not the value of any of the variables.


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 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