我写了如下脚本:
#! /bin/bash
source service supervisor stop
source service supervisor start
source service nginx restart
用chmod 755
给了权限之后运行了一下。返回了:stopping supervisor...
之后将脚本改为:
#! /bin/bash
source service supervisor stop &&
source service supervisor start &&
source service nginx restart
再次运行,还是返回:
stopping supervisor...
等我再在终端中使用以下任意命令:
source service supervisor start
source service supervisor status
nginx的命令也是同样的情况。闪退之前会提示:
basename invalid option -- 'b'
Try 'basename --help' for more information.
对linux不太了解,看了两眼教程就写了脚本,这回知道错了。求各位给指点一二。
把source去掉试试