简体   繁体   English

无法在csh中获取bash配置文件

[英]cannot source bash profile in csh

I tried googling this for a while before asking my question....i have the below oracle user when it tried to login (su - oracle) seems like the .bash_profile is not getting picked up...i am testing that using a alias cmd that i put in there called "l" which does "ls -ltr"... 在询问我的问题之前,我尝试使用谷歌搜索一段时间....当尝试登录(su-oracle)时,我拥有以下oracle用户,似乎.bash_profile没有被获取...我正在使用我在其中输入的别名cmd称为“ l”,它执行“ ls -ltr” ...

Funny thing is when i go to corn shell(KSH)...and echo out my shell i still get CSH as my default shell....while on my default shell(CSH) i cannot source my .bash_profile.... what am i doing wrong here ??...the profile gets created by default when we create a new user using "useradd" cmd.... 有趣的是,当我转到玉米壳(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>

this was my bad i guess...figured out what was wrong with it... 我猜这是我的错...弄清楚了这是怎么回事...

I am using csh as the user shell but asking it to read .bash_profile...which does not work....once i changed my user's shell back to /bin/bash in /etc/passwd it worked... 我正在使用csh作为用户外壳程序,但要求它读取.bash_profile ...这是行不通的....一旦我将用户的外壳程序更改为/ etc / passwd中的/ bin / bash它就可以了...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM