简体   繁体   English

从 bash 切换到 csh 提示符

[英]Switching from bash to csh prompt

I work on linux console and need to work on csh prompt.我在 linux 控制台上工作,需要在 csh 提示符下工作。 However the default prompt is bash and I have to give the command csh to change the mode.但是默认提示是 bash,我必须给出命令 csh 来更改模式。 The reason for switching the prompt is that there are some background files which run only in csh prompt.切换提示的原因是有一些后台文件只在csh提示下运行。

Example:例子:

-bash-4.1$ ade useview shkanodi_sqlplus_v1

bash: /usr/local/nde/setup/nderc.csh: line 44: syntax error near unexpected toke                                                                                                                     n `('
bash: /usr/local/nde/setup/nderc.csh: line 44: `foreach file (.ndeprodrc .ndevie                                                                                                                     wrc)'
bash: /etc/skel/cshrc-DEFAULT: line 20: syntax error: unexpected end of file

Explanation: In the above example the command ade useview shkanodi_sqlplus_v1 is not executed properly in bash prompt and I first have to give csh command and then run the command.说明:在上面的例子中,命令ade useview shkanodi_sqlplus_v1在 bash 提示符下没有正确执行,我首先必须给出 csh 命令,然后运行该命令。 I would like to bypass giving csh command.我想绕过给 csh 命令。

1.Make sure you've got csh installed. 1.确保你已经安装了 csh。

2.Learn the location of csh: 2.了解csh的位置:

which csh
or    
whereis csh

Below, I'll assume the location is /bin/bash.下面,我假设位置是/bin/bash。

a) If you have administrative rights, just run as root: a) 如果您有管理权限,只需以 root 身份运行:

usermod -s /bin/csh YOUR_USERNAME

(replacing YOUR_USERNAME with your user name). (用您的用户名替换 YOUR_USERNAME)。

b) If you don't have adm. b) 如果您没有管理员。 rights, you can still just run csh --login at login, by putting the below line at the end of your .profile (in your home directory) :权利,您仍然可以在登录时运行 csh --login,通过将以下行放在 .profile 的末尾(在您的主目录中):

setenv SHELL /bin/bash
exec /bin/csh --login

Refrence : bash from csh参考: 来自 csh 的 bash

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

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