Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I execute a bash script with following command:
./testscript &
It includes:
#!/bin/bash export testvar=OK ...
How can I access testvar from another bash script?
You need to source in testscript into another script for that using:
testscript
source ./testscript
OR else:
. ./testscript
That way you avoid creating a sub shell while executing ./testscript hence variable created remain in scope.
./testscript
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.