Pass all variables from one shell script to another?

Lets say I have a shell / bash script named test.sh with:

#!/bin/bash

TESTVARIABLE=hellohelloheloo
./test2.sh

My test2.sh looks like this:

#!/bin/bash

echo ${TESTVARIABLE}

This does not work. I do not want to pass all variables as parameters since imho this is overkill.

Is there a different way?

7 Answers
7

Leave a Comment