On Sat, 30 Sep 2017, L A Walsh wrote:
> > > Mikulas Patocka wrote: > > I don't set up OLDPWD in /etc/profile. > --- > No one does -- unless someone is trying to cause mischief. It's not > a likely event, but it would be annoying if someone did it. > But, FWIW, -- it seems like not using 'tainted' values from the > environment in a LOGIN SHELL, would be prudent. > Is it that difficult to only clear previous OLDPWD and > such when $0 == -bash (or when bash is about to read "/etc/bash_profile")? The problem occurs even in non-login shells - the chrome browser is started from a bash script, on some distributions firefox is also started from a bash script, mail daemon may start a script specified in user's ".forward" file. And these scripts also poke $OLDPWD and delay startup. Mikulas