在问我的问题之前,我尝试用谷歌搜索一段时间....我在尝试登录时有以下oracle用户(su - oracle),似乎.bash_profile没有被拾取...我正在测试使用我放在其中的名为“l”的别名cmd,它执行“ls -ltr”...
有趣的是,当我转到 Jade 米壳(KSH)...并回显我的壳时,我仍然将 CSH 作为我的默认壳...而在我的默认壳(CSH)上,我无法获取我的 .bash_profile...我在这里做错了什么?...当我们使用“useradd”cmd 创建新用户时,默认情况下会创建配置文件...
srv248:/oracle# su - oracle
srv248:/oracle/TEST> cat /etc/passwd | grep oracle
oracle:x:110:501:Oracle user:/oracle/TEST:/bin/csh
srv248:/oracle/TEST>
srv248:/oracle/TEST> cat .bash_profile
PATH=/usr/sbin:$PATH:/sbin:/bin:/sbin
stty erase ^?
umask 022
PS1=`tput smso``hostname | cut -d. -f1``tput rmso`":"'$PWD'"> "
alias p='pwd'
alias l='ls -ltr'
srv248:/oracle/TEST> l
l: Command not found.
srv248:/oracle/TEST> source .bash_profile
set: Variable name must begin with a letter.
srv248:/oracle/TEST>
srv248:/oracle/TEST> echo $SHELL
/bin/csh
srv248:/oracle/TEST>
srv248:/oracle/TEST> ksh
$
$ . ./.bash_profile
Value of TERM has been set to "xterm".
srv248:/oracle/TEST>
srv248:/oracle/TEST> l
total 68
drwx------ 2 oracle dba 16384 Mar 30 20:39 lost+found
drwxr-xr-x 2 oracle dba 4096 Aug 18 16:20 10g
drwxr-xr-x 2 oracle dba 4096 Aug 18 16:21 control
drwxr-xr-x 3 oracle dba 4096 Aug 18 18:04 data
srv248:/oracle/TEST>
srv248:/oracle/TEST> echo $SHELL
/bin/csh
srv248:/oracle/TEST>
最佳答案
我猜这是我的错...找出了问题所在...
我使用 csh 作为用户 shell,但要求它读取 .bash_profile...这不起作用...一旦我将用户的 shell 更改回/etc/passwd 中的/bin/bash,它就起作用了...
关于linux - 无法在 csh 中获取 bash 配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32082305/