in reply to Re: Set env variables as part of a command
in thread Set env variables as part of a command

and the vars don't seem to show up in the process list, though I'm no expert there lanx@lanx-1005HA:~$ ps -edaf |grep perl

ps' command line handling is quite messy: "e" and "-e" are completely different things. "-e" shows all processes, "e" shows the environment variables.

Environment variables are always visible, temporary or not.

So:

>env - foo=bar environment=unsafe sleep 100 & [1] 28318 >ps e | grep sl[e]ep 28318 pts/0 S 0:00 sleep 100 foo=bar environment=unsafe >

Or:

>foo=bar environment=unsafe sleep 100 & [1] 28338 >ps e | grep sl[e]ep 28338 pts/0 S 0:00 sleep 100 foo=bar environment=unsafe TERM=x +term SHELL=/bin/bash (... and many more) >

Update: So, effectively, there are no "temporary" environment variables, at least not when looking at process environments. Shells like bash have their own set of variables, they are often referenced to as environment variables, but they aren't, at least not all of them. "Exporting" variables, e.g. with export FOO, promotes a variable from a private piece of memory to an environment variable that is passed to other processes. Prefixing a command with variable=value does the same, inside the sub-process forked to execute the command.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)