test.sh:
#!/bin/bash
export test_var=1
Run the script, then continue to run the command in the terminal: echo $test_var, I got nothing. Why? Since test_var was exported, I thought I could continue to use the variable in the terminal.
test.sh:
#!/bin/bash
export test_var=1
Run the script, then continue to run the command in the terminal: echo $test_var, I got nothing. Why? Since test_var was exported, I thought I could continue to use the variable in the terminal.