Reputation: 2406
I have two scripts, the 'main' script, script A and a script B which contains some variables. In script A, I include script B for use the variable defined in the script B like so:
scriptA:
. ./scriptb
...
echo $toto
scriptB:
export toto="hello !"
When I run my script A, I get the output:
$./scriptA
/home/user/scriptb
hello !
My question is how to remove the undesired /home/user/scriptb
from output.
Upvotes: 0
Views: 86
Reputation: 1220
The code you provided in your question doesn't have any problem:
$ cat scripta
. ./scriptb
echo $toto
$ cat scriptb
export toto="hello!"
$ ./scripta
hello!
Upvotes: 1