Solved

bash

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

by Batuhan Cetin Regular expression is a language that we use to edit a string or retrieve sub-strings that meets specific rules from a text. A regular expression can be applied to a set of string variables. There are many RegEx engines for u…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…

820 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