简体   繁体   English

如何确定运行bash shell的解释器?

[英]How can I determine the interpreter that runs my bash shell?

I was working on this tutorial here and I want to know the path so I can put it in my shell scripts on the top line as is good practice. 我在这里从事本教程的工作,我想知道路径,因此可以将其作为最佳做法放在顶层的shell脚本中。

I was told this is not accurate: 有人告诉我这不正确:

echo "$SHELL"

What is the correct way to determine the path to the interpreter for shell scripts? 确定shell脚本解释器路径的正确方法是什么?

This is a shared hosting account and it is not obvious where it is located. 这是一个共享的托管帐户,位置不明显。

This is a follow up to a similar but not duplicate here . 这是一个后续的类似但不重复这里

You can use 您可以使用

which -a bash

to list all paths for the current user that point to a bash program. 列出当前用户指向bash程序的所有路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Java 中运行我自己的个性化 bash shell? - How can I run my own personalized bash shell in Java? my_script抛出bash错误:/ home / usr / bin / my_sript:bin / bash /错误的解释器:没有这样的文件或目录。 我该如何纠正该错误? - my_script throwing an error of bash: /home/usr/bin/my_sript: bin/bash/ bad interpreter: No such file or directory. How can I correct this error? 如何确定shell管道中最慢的组件? - How do I determine the slowest component of my shell pipeline? 如何从bash脚本确定IP地址? - How can I determine the IP address from a bash script? 如何确定bash脚本中的触摸屏设备? - How can I determine touch screen device in a bash script? 我已经将bash命令集成到了我的Python代码中-如何获取此命令以从Shell中获取输入? - I have integrated a bash command into my Python code - how can I get this command to take an input from the shell? 如何在bash shell脚本中将值附加到空数组? - How can I append values to an empty array in bash shell script? Bash Shell:如何知道TeamViewer是否已断开连接? - Bash Shell: How can I know if TeamViewer has disconnected? bash子字符串在解释器模式下工作,但在shell脚本中不工作 - bash substring working in interpreter mode but not in shell script 如何从 Bash shell 的输出中切断字符串? - how can i cut off the strings from an output in Bash shell?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM