[Xquartz-dev] 2.3.2_rc4

Cameron Simpson cs at zip.com.au
Tue Dec 23 14:13:32 PST 2008


On 23Dec2008 10:23, Martin Costabel <costabel at wanadoo.fr> wrote:
> Cameron Simpson wrote:
> []
>> Meanwhile, here's a beefier single-script solution that:
[...]
>> Here's the link:
>>   http://www.cskk.ezoshosting.com/cs/css/bin/with-login-env
>> Usage:
>>   with-login-env some-command [args...]
>
> This doesn't work with bash. If run with the --have-login-env flag, it says
> ./with-login-env: line 27: _WITH_LOGIN_ENV_QUOTED_COMMAND: unbound variable

That's expected. That option should only ever be used by the script,
internally, to call itself.

> If run without the flag, it does not load the bash startup scripts.
> As I repeatedly said, bash does *not* load its startup scripts if run
> after "exec -l" or after /usr/bin/login. It is correctly executed with
> the name "-bash", but it does not start up as a login shell. Whether
> this is a bug in Apple's version of bash, I don't know, but this is how
> it behaves. You have to use "bash --login" to have it read its startup
> scripts.

Can you specify a little more here? Can you verify (maybe by putting a
few echo statements in files) that it does not run the .bash_profile nor
.profile files? Meanwhile, I'll test that myself here too.

Your assertion seems not to hold here:

  [/Users/cameron]fleet*> cat .bash_profile
  echo BASH PROFILE
  [/Users/cameron]fleet*> bash --login
  BASH PROFILE
  fleet:~ cameron$ exec -l /bin/bash
  BASH PROFILE
  fleet:~ cameron$ exit
  logout

It seems to work just fine, which is expected since that's what login
does as well.

Maybe you are expecting .bashrc to run? That is not where login bashes
look for stuff, and not where login environment settings belong.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/


More information about the Xquartz-dev mailing list