When to use the set and when to use export command?
Under what situation do I need to use the set command, the export command or both together?
Thanks! |
In a terminal enter:
man set and press return. Read all about it, then enter: man export and press return. If you have problem navigating man pages, enter: man man and press return. I think this will answer most of your questions, but answer back if it does not. |
The set command is used to see or modify environmental variables. These variables control the behavior of the shell. You would use set to change one of these variables. Export is used in scripting to make a variable visible to other processes that are running. If you export a variable that is the same name as one of the variables that the shell uses, then you have in effect changed the value of that variable. Hope that helps.
|
Thanks for the reply :)
So in effect, set command and export command both allow you to change your environmental variables, but only export command allow the variable to be visible to other running processes? Quote:
|
i think set effects environmental variables, and export makes them environmental (meaning they can be seen by other processes).
|
So in order to set my proxy server, which is the right serquence?
export HTTP_PROXY=http://proxy.server.com:8080/ set HTTP_PROXY or set HTTP_PROXY export HTTP_PROXY=http://proxy.server.com:8080/ ? Also, do the settings stay after a reboot? Thanks again ! Quote:
|
All times are GMT -5. The time now is 03:15 PM. |