set or env?
Hi,
The commands set and env both deliver the environment variables and their values, however Code:
set | wc -l Could somebody name a good tutorial with examples? Regards, Carsten |
Hi Carsten,
The difference is that 'set' is also reporting shell-local variables. These look the same from the point of view of the shell user, but are not passed on to the new process if you run a command. When you use the 'export' command you promote a shell variable to be an environment variable. Environment variables are a fundametal feature of Linux, while shell variables are just a feature of the shell. To fully understand how environment variables work you really need to appreciate the fork/exec process model. I would direct you to the mighty Rute for some explanation: http://www.icon.co.za/~psheer/book/node12.html.gz TIM |
Tim,
Thank you very much for the excellent explanation. And thank you also for the Rute link. I read the Rute book more than 4 years ago, and I completely forgot about it. Great book. Regards, Carsten |
All times are GMT -5. The time now is 01:16 AM. |