help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] Strange behavior with "su -" and bash on AIX


From: Henning J Wilbert
Subject: [Help-bash] Strange behavior with "su -" and bash on AIX
Date: Fri, 20 Feb 2015 09:54:29 +0100

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.
To clarify:
========================================================================
bash --version
GNU bash, version 4.2.50(1)-release (powerpc-ibm-aix6.1.2.0)

address@hidden: echo "export ASDF=lol" >> ~user/.profile
address@hidden: su - user -c "echo \$ASDF"

address@hidden: su - user
address@hidden: echo $ASDF
lol
========================================================================

This works fine on Linux, but not on AIX. When providing the "--login" 
option, it also works on AIX:
========================================================================
address@hidden: su - user --login -c "echo \$ASDF"
lol
========================================================================

When using ksh instead of bash, .profile gets sourced as expected in the 
"su - <user> -c" command.

So I'm confused here... is this a su - issue, a bash - issue, am I the 
issue...? Thanks!

Regards,
Henning Wilbert




reply via email to

[Prev in Thread] Current Thread [Next in Thread]