我在Mac中使用哪个shell [英] Which shell I am using in mac

查看:304
本文介绍了我在Mac中使用哪个shell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Mac中的默认外壳是bash.
我试图通过命令chsh -s /bin/zsh将其更改为ZSH.

Default shell in my mac was bash.
I have tried to change it into ZSH by command chsh -s /bin/zsh.

现在,当我尝试检查外壳类型时,会得到不同的响应.

Now when I am trying to check the shell type, I am getting different responses.

输入:echo $SHELL
输出:/bin/zsh

input : echo $SHELL
output : /bin/zsh

输入:ps $o
输出:7655 ttys002 0:00.03 -bash

input : ps $o
output : 7655 ttys002 0:00.03 -bash

输入:ps -p $$ | awk '$1 == PP {print $4}' PP=$$
输出:-bash

input : ps -p $$ | awk '$1 == PP {print $4}' PP=$$
output : -bash

我不确定我使用的是哪个shell. 我是否需要做其他事情才能将我的shell更改为 ZSH .

I am not sure which shell I am using. Do I need to do something additional to change my shell into ZSH.

推荐答案

macOS的Terminal允许您在其首选项中指定shell.默认情况下,它设置为使用您的登录Shell,但看起来您已覆盖它以使用Bash.

macOS's Terminal allows you to specify the shell in its preferences. By default, it is set to use your login shell, but it looks like you've overridden it to use Bash.

在终端"首选项的常规"选项卡中,将其设置为默认登录外壳",以防止覆盖您的登录外壳:

In the General tab of Terminal's preferences, set it to "Default login shell," to prevent your login shell from being overridden:

此外,请确保未在配置文件设置的外壳程序"标签中选中运行命令"复选框:

Also, make sure the "Run command" checkbox is not checked in the Shell tab of your profiles' settings:

这篇关于我在Mac中使用哪个shell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆