[Techtalk] simple date question

Akkana Peck akkana at shallowsky.com
Thu Oct 10 16:57:56 UTC 2013


> On Wed, Oct 09, 2013 at 04:17:16AM +0000, mgmonza at sdf.lonestar.org wrote:
> > Sudo export TZ=America/New_York just gives a command not recognized
> > message.

John Clarke writes:
> That's because "export VAR=value" is a shell built-in.  It's an
> abbreviation of "VAR=value; export VAR" and tells the shell to set VAR,
> and to propagate the variable in the environment of any subprocesses it
> starts from then on.
> 
> There is no way to add variables into the environment of already
> runnng processes; variables have to be set by a process or inherited
> from its parent.

But if you export VAR=value at the time you log in, it will be
propagated to all processes you run during that session. So you
need to stick that line into some file that your login environment
runs before it starts launching other processes. What file that is
depends on what desktop/window manager you run (I run openbox so
I'm probably no help to gnome/kde/unity users).

It would still be better to set the whole system's time zone rather
than patching your login environment, though. For instance, it would
be nice if timestamps in log files were in the right time zone.

	...Akkana


More information about the Techtalk mailing list