[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Strange behavior with "su -" and bash on AIX
From: |
Chet Ramey |
Subject: |
Re: [Help-bash] Strange behavior with "su -" and bash on AIX |
Date: |
Fri, 20 Feb 2015 10:59:03 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 2/20/15 3:54 AM, Henning J Wilbert wrote:
> Dear bash-team,
>
> I have trouble understanding an issue that involves bash on AIX, any help
> highly appreciated.
> On AIX, having a user with bash as default-shell, "su - <user> -c
> 'command'" doesn't source any profile. No .profile, .bash_profile,
> .bash_login, .bashrc.
Bash usually doesn't run any startup files when invoked non-interactively,
and `-c command' is such a case. The shell tries to guess when it's run
by `su -' and run the startup files, but unless `su' indicates this in some
way -- usually by setting argv[0] to `-su' -- bash has no way of knowing
this.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/