still unclear, but some comments:
Quote:
Originally Posted by paulspedding
#!/bin/bash
AUTH_TOKEN=$(this gets my auth token)
declare -g AUTH_TOKEN="$AUTH_TOKEN"
|
Is this a script you executed? So it will set AUTH_TOKEN, but it will not be available in the parent shell anyway. You need to use
source if you wish to modify the environment of the current shell.
Quote:
Originally Posted by paulspedding
And then when I goto view it I use echo "$AUTH_TOKEN" I have tried the -x an -g and AFAIK the '-x' is the same as using: export AUTH_TOKEN="$AUTH_TOKEN" Isn't it? I also just tried using export but it didnt work either.
|
I have no idea what do you mean by that. How did you try -x and -g ?
Quote:
Originally Posted by paulspedding
I was using to view the varible using both the following:
printenv
OR
declare -p
But I could never see them set. I did try to use `echo "$AUTH_TOKEN"` a few times but that yeilded empty results.
|
Again, I think you set the variable in a subshell, and checks the result in the current shell. But it is only a guess, I still don't understand what did you do.