# Help with eval usage for string containing Environment Variable

**URL:** <https://community.unix.com/t/help-with-eval-usage-for-string-containing-environment-variable/249195>\
**Category:** Shell Programming and Scripting\
**Created:** [September 13, 2009, 7:54pm UTC](https://community.unix.com/t/help-with-eval-usage-for-string-containing-environment-variable/249195 "2009-09-13T19:54:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhangliter](https://community.unix.com/letter_avatar/dhangliter/32/5_5575768a8748004e209b776fc1b2916d.png) [@dhangliter](https://community.unix.com/u/dhangliter)\
**Post date:** [September 13, 2009, 7:54pm UTC](https://community.unix.com/t/help-with-eval-usage-for-string-containing-environment-variable/249195/1 "2009-09-13T19:54:21Z")

</div>

Help !!

First, Thanks in Advance

Here is what I have

I have an environment Variable, let's call it v\_VALUE.  
v\_VALUE="\$ORACLE\_HOME/bin" Hence, the location is ORACLE\_HOME is not evaluated. ORACLE\_HOME happens to be /app/oracle/product/10.1.2

I need a method of returning the evaluated string.  
I tried  
v\_VALUE="\$ORACLE\_HOME/bin"  
v\_EVALUATED=`eval $v_VALUE`

I want v\_EVALUATED to contain /app/oracle/product/10.1.2/bin

I'm trying to create a generic script and the value of ORACLE\_HOME is dynamic and will be contained in a config file, hence, the need to evaluate on the fly

Thanks !!

---

<div class="post-metadata">

**Author:** ![durden\_tyler](https://community.unix.com/user_avatar/community.unix.com/durden_tyler/32/1450_2.png) [@durden\_tyler](https://community.unix.com/u/durden_tyler)\
**Post date:** [September 13, 2009, 10:42pm UTC](https://community.unix.com/t/help-with-eval-usage-for-string-containing-environment-variable/249195/2 "2009-09-13T22:42:36Z")

</div>

> [@dhangliter](#):
>
> ...  
> ORACLE\_HOME happens to be /app/oracle/product/10.1.2  
> ...

So we have:

```plaintext
$ 
$ ORACLE_HOME=/app/oracle/product/10.1.2
$ echo $ORACLE_HOME
/app/oracle/product/10.1.2
$ 

```

> [@](#):
>
> ...  
> I want v\_EVALUATED to contain /app/oracle/product/10.1.2/bin  
> ...

So, v\_evaluated is set thusly -

```plaintext
$ 
$ v_evaluated=$ORACLE_HOME/bin
$ echo $v_evaluated
/app/oracle/product/10.1.2/bin
$ 
$ 

```

tyler\_durden
