困惑 - 我真的有哪些外壳?

时间:2023-02-05 01:51:57

The commands which I ran and their outputs are given below -

我运行的命令及其输出如下 -

$ echo $SHELL
/bin/bash

$ whence bash
sh: whence: command not found

$ which bash
/usr/bin/bash

I am not sure which shell I really have. First one says bash and the second says sh. So, which shell is it ? bash or sh ?

我不确定我真的有哪种外壳。第一个说bash,第二个说sh。那么,它是哪个外壳? bash还是sh?

2 个解决方案

#1


1  

This should clarify what you are using:

这应该澄清你在使用什么:

echo $BASH_VERSION

#2


0  

Check to make sure that /usr/bin isn't a link to /bin or vice-versa and that /usr/bin/bash isn't a link to /bin/bash or vice versa. It is possible that you are running one binary, /bin/bash, but that your path lists /usr/bin before /bin, in which case, which bash would list /usr/bin/bash - but that only means that /usr/bin/bash is the one you will run if you type bash on the command line. It doesn't mean it is the one you're running.

检查以确保/ usr / bin不是/ bin的链接,反之亦然,/ usr / bin / bash不是/ bin / bash的链接,反之亦然。您可能正在运行一个二进制文件/ bin / bash,但是您的路径在/ bin之前列出/ usr / bin,在这种情况下,哪个bash会列出/ usr / bin / bash - 但这仅表示/ usr / bin / bash是在命令行上键入bash时将运行的那个。这并不意味着它就是你正在运行的那个。

#1


1  

This should clarify what you are using:

这应该澄清你在使用什么:

echo $BASH_VERSION

#2


0  

Check to make sure that /usr/bin isn't a link to /bin or vice-versa and that /usr/bin/bash isn't a link to /bin/bash or vice versa. It is possible that you are running one binary, /bin/bash, but that your path lists /usr/bin before /bin, in which case, which bash would list /usr/bin/bash - but that only means that /usr/bin/bash is the one you will run if you type bash on the command line. It doesn't mean it is the one you're running.

检查以确保/ usr / bin不是/ bin的链接,反之亦然,/ usr / bin / bash不是/ bin / bash的链接,反之亦然。您可能正在运行一个二进制文件/ bin / bash,但是您的路径在/ bin之前列出/ usr / bin,在这种情况下,哪个bash会列出/ usr / bin / bash - 但这仅表示/ usr / bin / bash是在命令行上键入bash时将运行的那个。这并不意味着它就是你正在运行的那个。