我尝试按照如何更改 AWS 实例上的默认 shell 中推荐的方式更改它。, 如下所示:
chsh -s $(which zsh)
Run Code Online (Sandbox Code Playgroud)
但这给了我一个错误。系统要求我改为使用ypchsh,但这给了我以下错误消息:
ypchsh: can't get local yp domain: Local domain name not set
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能将我的远程 shell 设置为zsh?
您可以联系系统管理员并询问是否应该支持该功能,如果是,请他/她修复它。
我在不支持将 shell 更改为 zsh 的集群中执行的操作是这样的(在我的内部~/.bashrc):
# if this is an interactive shell
if [[ $- == *i* ]]; then
# if on one of those annoying hosts...
if [[ `uname -n` == PATTERN_MATCHING_SOME_HOSTNAMES ]]; then
# if there is actually a zsh command available
if [[ -x `which --skip-alias zsh 2>/dev/null` ]]; then
# avoid spawning zsh every time bash is started...
if [ -z $ZSH_STARTED ]; then
export ZSH_STARTED="true"
# if the call to zsh fails, scp a different conf there
exec zsh
fi
fi
fi
fi
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4204 次 |
| 最近记录: |