# Setting variable

**URL:** <https://community.unix.com/t/setting-variable/165152>\
**Category:** Shell Programming and Scripting\
**Created:** [September 14, 2006, 3:33pm UTC](https://community.unix.com/t/setting-variable/165152 "2006-09-14T15:33:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![briskbaby](https://community.unix.com/letter_avatar/briskbaby/32/6_449c533f586939b6e5f246632a46421f.png) [@briskbaby](https://community.unix.com/u/briskbaby)\
**Post date:** [September 14, 2006, 3:33pm UTC](https://community.unix.com/t/setting-variable/165152/1 "2006-09-14T15:33:14Z")

</div>

How do you set a varible with information that contains a string and also another variable? For example:

subject="Attention: $name / This $type needs your attention"

The $xxxx are of course other variables that I instantiated earlier. Is it like Java where you have to use double quotes and then single quotes within? Can someone please provide an example. Thanks!

---

<div class="post-metadata">

**Author:** ![anbu23](https://community.unix.com/user_avatar/community.unix.com/anbu23/32/351_2.png) [@anbu23](https://community.unix.com/u/anbu23)\
**Post date:** [September 14, 2006, 4:10pm UTC](https://community.unix.com/t/setting-variable/165152/2 "2006-09-14T16:10:36Z")

</div>

what you are doing is right

> [@](#):
>
> name="briskbaby"  
> type="int"  
> subject="Attention: $name / This $type needs your attention"
