|
#!/bin/bash
PATH=/sbin:/bin
SCRIPT_DIR="/etc/rc$1.d"
if[ -d $SCRIPT_DIR ]; then
for SCRIPT in $SCRIPT_DIR/K*
do
if[ -x $SCRIPT ]
then
$SCRIPT stop
fi
done
for SCRIPT in $SCRIPT_DIR/S*
do
if [ -x $SCRIPT ]
then
$SCRIPT start
fi
done
fi
sh -n rc 得到下面的结果(文件名为rc)
[root@localhost init.d]# sh -n rc
rc: line 4: syntax error near unexpected token `then'
rc: line 4: `if[ -d $SCRIPT_DIR ]; then'
请各位指教!
新手请多谅解! |
|