Question: I have two independently running scripts.
first one lets say script A calculates some values. And i want to echo these values from other script called B. These scripts will not call each other. I have used export keyword but didn't work. How can i do this?

Answer: 
If I understood the requirement then can't both scripts be simply executed in same sub shell, independently but **without** calling each other or without any need of an external file or pipe like this:

Let's say this is your **script1.sh**

```
#!/bin/bash
# script1.sh: do something and finally
export x=19

```

And here us your **script2.sh**

```
#!/bin/bash
# script2.sh: read value of $x here
echo "x="${x}

```

Just call them in same sub-shell like this

```
(. ./script1.sh && ./script2.sh)

```

**OUTPUT:**

```
x=19

```
Actually all your need is `source` you can skip the `export` prefix.

*My use-case was an environment specific settings file, example:*

Within **main\_script.sh**

```
THIS_DIR=`dirname $0`
source $THIS_DIR/config_vars.sh
# other commands

```

Within **config\_vars.sh**

```
LOCAL_ROOT="$HOME/folder/folder"
REMOTE_USERNAME='someuser'
BACKUP_FOLDER="$LOCAL_ROOT/folder"
# etc.

```