linux – 我怎么知道我使用的是哪个shell?

我正在写一个 shell脚本.我正在阅读的教程有第一行,如下所示:

#!/usr/bin/env bash /

但它不适合我. (错误:没有这样的目录)

我怎样才能知道我正在使用哪个bash以及它位于何处?

感谢任何建议和帮助.

非常感谢.它现在有效.

解决方案是#!/usr/bin/env bash

一个问题:为什么它只是无法读取’重启’这个词

我的代码在start.sh中:

#!/usr/bin/env bash/
RESTART="apachectl restart"
$RESTART

我不工作.

Usage: /usr/local/apache2/bin/httpd [-D name] [-d directory] [-f file]
                                [-C "directive"] [-c "directive"]
                                [-k start|restart|graceful|graceful-stop|sto                                                                             p]
                                [-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name            : define a name for use in <IfDefine name> directives
-d directory       : specify an alternate initial ServerRoot
-f file            : specify an alternate ServerConfigFile
-C "directive"     : process directive before reading config files
-c "directive"     : process directive after reading config files
-e level           : show startup errors of level (see LogLevel)
-E file            : log startup errors to file
-v                 : show version number
-V                 : show compile settings
-h                 : list available command line options (this page)
-l                 : list compiled in modules
-L                 : list available configuration directives
-t -D DUMP_VHOSTS  : show parsed settings (currently only vhost settings)
-S                 : a synonym for -t -D DUMP_VHOSTS
-t -D DUMP_MODULES : show all loaded modules
-M                 : a synonym for -t -D DUMP_MODULES
-t                 : run Syntax check for config files

为什么会那样?似乎它可以读取重启一词.

谢谢你们!我现在修好了.

解决方案:在unix中编辑文件(vim / nano以及Windows中的任何内容)

Thank again :)

解决方法

您可以尝试以下命令
which bash

一个壳.然后把

#!<the output of which bash>

相关文章

/etc/sysctl.conf这个目录主要是配置一些系统信息,/etc/sys...
1.作用 useradd或adduser命令用来建立用户帐号和创建用户的起...
它们都是多模式编辑器,不同的是vim 是vi的升级版本,它不仅...
不管是我们在安装软件还是监测软件的使用性能,我们都要随时...
装好Tomcat7后,发现除了本机能访问外界访问不了,岂有此理。...
修改防火墙配置需要修改 /etc/sysconfig/iptables 这个文件,...