variable one script to another
can a variable from one file be used in another so for instance
if say test.sh had var="hello" could i call that var form say test.1.sh so it would display the var when i run test1.sh basically i am writing a http interface with user input outputing that to a file and would like to use another file to exec all the variables thanks in advance |
Only if you source the script(s), and the variables are
exported ... Cheers, Tink |
Tinkster is correct. Another alternative is to use the "." to read an initialization file.
EXAMPLE: vi myenv => Code:
export ONE=1 Code:
echo "BEFORE: ONE= $ONE, TWO= $TWO, THREE= $THREE." Quote:
|
All times are GMT -5. The time now is 08:33 AM. |