# variable inside a variable

**URL:** <https://community.unix.com/t/variable-inside-a-variable/249007>\
**Category:** UNIX for Dummies Questions & Answers\
**Created:** [September 10, 2009, 10:32am UTC](https://community.unix.com/t/variable-inside-a-variable/249007 "2009-09-10T10:32:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mokachoka](https://community.unix.com/user_avatar/community.unix.com/mokachoka/32/5387_2.png) [@mokachoka](https://community.unix.com/u/mokachoka)\
**Post date:** [September 10, 2009, 10:32am UTC](https://community.unix.com/t/variable-inside-a-variable/249007/1 "2009-09-10T10:32:56Z")

</div>

Im trying to set a variable from within a script with the value of another variable inside it.

FILE=/home/transfer/$ACCOUNTINPUT\_sendscript.sh

This doesnt seem to work... Can anyone be kind enough to tell me why? 🙂

---

<div class="post-metadata">

**Author:** ![rubionis](https://community.unix.com/letter_avatar/rubionis/32/5_5575768a8748004e209b776fc1b2916d.png) [@rubionis](https://community.unix.com/u/rubionis)\
**Post date:** [September 10, 2009, 10:44am UTC](https://community.unix.com/t/variable-inside-a-variable/249007/2 "2009-09-10T10:44:18Z")

</div>

> [@mokachoka](#):
>
> Im trying to set a variable from within a script with the value of another variable inside it.
> 
> FILE=/home/transfer/$ACCOUNTINPUT\_sendscript.sh
> 
> This doesnt seem to work... Can anyone be kind enough to tell me why? 🙂

```plaintext
FILE="/home/transfer/${ACCOUNTINPUT}_sendscript.sh"

```

---

<div class="post-metadata">

**Author:** ![siba.s.nayak](https://community.unix.com/letter_avatar/siba.s.nayak/32/5_5575768a8748004e209b776fc1b2916d.png) [@siba.s.nayak](https://community.unix.com/u/siba.s.nayak)\
**Post date:** [September 10, 2009, 10:45am UTC](https://community.unix.com/t/variable-inside-a-variable/249007/3 "2009-09-10T10:45:41Z")

</div>

```nohighlight
FILE=/home/transfer/${ACCOUNTINPUT}_sendscript.sh

```

Syntax should be like this.

---

<div class="post-metadata">

**Author:** ![mokachoka](https://community.unix.com/user_avatar/community.unix.com/mokachoka/32/5387_2.png) [@mokachoka](https://community.unix.com/u/mokachoka)\
**Post date:** [September 10, 2009, 11:10am UTC](https://community.unix.com/t/variable-inside-a-variable/249007/4 "2009-09-10T11:10:38Z")

</div>

thank you, would you believe it, i worked it out 2mins after i posted... Thanks anyway.
