Bug 19210 - su - 用户 -c "命令" 不会生效用户下的 .bash_profile 环境变量
Summary: su - 用户 -c "命令" 不会生效用户下的 .bash_profile 环境变量
Status: NEW
Alias: None
Product: Anolis OS 23
Classification: Anolis OS
Component: Others (show other bugs) Others
Version: 23.2
Hardware: x86_64 Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: happy_orange
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-05 09:49 UTC by Lucifer
Modified: 2025-03-05 09:49 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lucifer 2025-03-05 09:49:32 UTC
Description of problem: 在龙蜥23系统中,su - 用户 -c "命令" 不会生效用户下的 .bash_profile 环境变量。而在红帽 REDHAT 中是可以生效的。

Version-Release number of selected component (if applicable):23.2


龙蜥23.2:

[oracle@anolis23:/home/oracle]$ cat /etc/os-release 
NAME="Anolis OS"
VERSION="23.2"
ID="anolis"
VERSION_ID="23.2"
PLATFORM_ID="platform:an23"
PRETTY_NAME="Anolis OS 23.2"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugzilla.openanolis.cn/"

[root@anolis23:/root]# su - oracle -c "sqlplus -v"
-bash: line 1: sqlplus: command not found
[root@anolis23:/root]# su - oracle
[oracle@anolis23:/home/oracle]$ sqlplus -v

SQL*Plus: Release 11.2.0.4.0 Production


红帽 8.10:

[root@orcl19c:/root]# cat /etc/os-release 
NAME="Red Hat Enterprise Linux"
VERSION="8.10 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.10"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.10 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.10
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.10"

[root@orcl19c:/root]# su - oracle -c "sqlplus -v"

SQL*Plus: Release 19.0.0.0.0 - Production
Version 19.3.0.0.0