Solved

bash

Posted on 2011-09-29
5
185 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

777 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