How to set an environment variable question
Hi all.
I have seen 2 versions for the following: export PATH=$PATH:/some_directory and export PATH=${PATH}:/some_directory Is anyone of them better than the other? Or in other words, are '{' and '}' redundant? (I don't know shell programming). Thank you a lot, -- Ioannis Vranos http://cppsoftware.binhoster.com -- ubuntu-users mailing list ubuntu-users@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
How to set an environment variable question
Ioannis Vranos wrote:
> I have seen 2 versions for the following: > > export PATH=$PATH:/some_directory > > and > > export PATH=${PATH}:/some_directory > > > Is anyone of them better than the other? Or in other words, are '{' > and '}' redundant? (I don't know shell programming). In this case there is no difference. Braces are useful if you want to mix variables and text. Try this to see the difference: a=hell echo $ao echo ${a}o The first echo command has no output because the variable "ao" is undefined (unless you have set it for some reason). The second echo command uses the contents of variable "a" and appends an "o". Nils -- ubuntu-users mailing list ubuntu-users@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
| All times are GMT. The time now is 05:13 AM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.