Я пишу сценарий оболочки.Урок, который я читаю, имеет следующую строку:
#!/usr/bin/env bash/
, но он не работает для меня.(error : no such directory
)
Как узнать, какой bash я использую и где он находится?
Спасибо за любые советы и помощь.
Спасибомного.Теперь он работает .
решение - это #!/usr/bin/env bash
Еще одна проблема: почему он просто не может прочитать слово «рестарт»
мой код в начале .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 :)