Solved

bash

Posted on 2011-09-29
5
182 Views
Last Modified: 2012-05-12
hum-tum_tit_for_tat_SIZE = 40

INST = hum-tum

 eval TEMP_SIZE="$"${INST}_tit_for_tat_SIZE

it is not evaluating to 40 rather it is evaluating to -tum_tit_for_tat_SIZE
can you pls fix it

the answer should come as
TEMP_SIZE to 40  
but ima getting wrong answer as
TEMP_SIZE = -tum_tit_for_tat_SIZE

0
Comment
Question by:damodar4u
  • 3
5 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 334 total points
ID: 36839804
Try this:

TEMP_SIZE=$(eval echo \$${INST}_tit_for_tat_SIZE)

Sorry don't have shell at this time to test.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 36839928
But if you give me the feed back I can probably fix any problems
0
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 334 total points
ID: 36840558
There appears to be another problem.  The variable name hum-tum is invalid.  Dash is an invalid character in the variable name
0
 

Author Comment

by:damodar4u
ID: 36843614
how to overcome that is there any fix that i want to use - in variable names.
0
 
LVL 84

Assisted Solution

by:ozo
ozo earned 166 total points
ID: 36891098
The fix is to use alphanumeric  characters and underscores in variable names.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now