我在什么壳里? [英] What shell am I in?

查看:29
本文介绍了我在什么壳里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有命令可以识别当前 shell 的名称/类型、shell 二进制文件的路径以及 shell 的版本?

Is there a command to identify the name/type of current shell, the path to the shell binary, and the version of the shell?

我不需要所有这些,但我能得到的越多越好.

I don't need all of that, but the more I can get, the better.

我想要一些与 unamepwdwhoami 具有相同感觉的东西.只是一个带有简单输出的普通实用程序.(到目前为止还没有出现:/)

I want something that has the same feel of uname, pwd, whoami. Just a plain utility with a simple output. (which so far hasn't showed up :/ )

$ ps -o comm $$
COMM
-bash

为什么使用 -bash 而不是完整路径,因为它与其他所有内容一样?那里的破折号是怎么回事?

Why -bash instead of the full path as it would be with everything else? What's the deal with the dash there?

推荐答案

我想要一些与 unamepwdwhoami 具有相同感觉的东西.只是一个带有简单输出的普通实用程序.

I want something that has the same feel of uname, pwd, whoami. Just a plain utility with a simple output.

很明显,结论是我想要的工具不存在,而且没有简单的跨平台方法来解决这个问题.

So apparently the conclusion is that the tool I want does not exist, and there's no simple cross-platform way to go about this.

这里的一些答案在 Linux 上运行良好.

Some answers here work fine on Linux.

这篇关于我在什么壳里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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