Question: I learned the following command-

`$[variable]-If set, access the variable`

In this command what type of **variable** it is talking about?

Answer: 
$ means to substitute the value of the following expression. I can be used with variables or commands. To use it with commands, parenthesis are placed around the command.

### Example 1 - variables:

```
x=hello
echo $x

```

this will print "hello" in the terminal

### Example 2 - commands

Say I have a file named hello.txt with the contents:

```
Hello
world.
Good
Morning

```

Then I can do:

```
echo $(cat hello.txt)

```

the output would be:

```
Hello world. Good Morning

```

### Example 3 -- Variable command expansion

This can also be used to allow user input in a script. For example say I have a script that executes a file, I can allow the user to specify where the file is and save it as path. Then do:

```
exec $path/file.sh

```

If path="/home/me", then the command would expand to:

```
exec /home/me/file.sh

```
`$[variable]` is referring to a variable that you set with the following command:

`VARIABLE=<path>`

`<path>` can be anything. It can be a path to another drive, a file server, a document, an application, and even a shortcut.