Question: How can I set variables to be used in scripts as well? They don't have to be global / system-wide, just the current session is sufficient. But for some reason they seem gone even if I run a script right from my current terminal.

Example:

```bash
foo=bar
echo "$foo"

```

output: `bar`

However if test.sh contains `echo "$foo"` and I do:

```
foo=bar
./test.sh

```

The output is empty. How do I set a scope for temporary variables with a terminal session that remains valid when executing scripts from that same session?

Answer: 
`export foo=bar` will set the global variable $foo to bar. You can also use `foo=bar ./test.sh` as a single command to set foo to bar for test.sh.
Another option could be to pass the variable to your script as an argument.

```
foo=bar
./test.sh $foo

```

The issue then becomes the contents of ./test.sh

It would have to `echo $1` instead of `echo $foo` - the $1 indicating the first argument passed to the script.