我怎样才能将我的 cygwin bash 转换为 ac Shell。
我尝试通过更改.bat
安装目录中的文件,例如:
请帮助。
是正确的过程吗?
虽然它对我有点用......
有什么想法......?
@echo off
@echo ----Welcome NAME----
@echo 'have a nice day'
cygdrive\
chdir \
set HOME=\cygwin\home\
tcsh -i
问问题
9827 次
2 回答
4
要更改 Cygwin shell,您可以更改/etc/passwd
文件。每一行都是用户帐户的分隔列表,其中最后一个条目是该用户的外壳。只需更改读取的行,例如:
abhisek:[some other stuff]:/usr/bin/bash
至:
abhisek:[some other stuff]:/usr/bin/tcsh
于 2012-05-17T16:04:28.273 回答
2
当前版本的 Cygwin 没有 /etc/passwd 文件,并且我正在使用的系统在域数据库中具有不受我控制的 Windows 帐户信息。因此, 不再支持chsh 。
我还发现 bash 没有硬编码到 startxwin 脚本中,也没有硬编码在任何 .bat文件中。事实证明,您根本不需要摆弄 .bat 文件。
搜索如何更改我的 shell,我发现了一些关于 mkpasswd 的建议
我把它加到混合物中。
手册页说:
SYNOPSIS mkpasswd [OPTIONS]... OPTIONS Don't use this command to generate a local /etc/passwd file, unless you really need one. See the Cygwin User's Guide for more information. -c,--current Print current user. DESCRIPTION The mkpasswd program can be used to create a /etc/passwd file. Cygwin doesn't need this file, because it reads user information from the Windows account databases, but you can add an /etc/passwd file, for instance if your machine is often dis‐ connected from its domain controller. Note that this information is static, in contrast to the informa‐ tion automatically gathered by Cygwin from the Windows account databases. If you change the user information on your system, you'll need to regenerate the passwd file for it to have the new information. For very simple needs, an entry for the current user can be cre‐ ated by using the option -c.
(我不知道为什么间距如此“关闭”......)
然后我使用了以下命令:
mkpasswd -c | sed -e 'sX/bashX/tcshX' | tee -a /etc/passwd
瞧!下次我打开 Cygwin 终端时,它直接进入 tcsh
就是这样(嗯,嗯,嗯!)我喜欢它。
于 2015-03-20T03:07:14.350 回答