Tagged Questions
2
votes
1answer
134 views
Why does this variable have no value even though it is set in .bashrc?
If I append this:
hi=11
export hi
to the .bashrc and then I su to this user with:
su - bela
then I:
echo $hi
11
Then it's working, the "hi" variable has the value of "11". But. When I:
...
8
votes
2answers
1k views
What is the significance of single and double quotes in environment variables?
I defined some environment variables in my .profile like this:
MY_HOME="/home/my_user"
but the variable does not seem to evaluate unless I strip off the quotes and re-source the file. I believe ...
23
votes
2answers
1k views
$VAR vs ${VAR} and to quote or not to quote
I can write
VAR=$VAR1
VAR=${VAR1}
VAR="$VAR1"
VAR="${VAR1}"
the end result to me all seems about the same. Why should I write one or the other? are any of these not portable/POSIX?