第2个回答 2014-06-06
我要开机运行mjpg-streamer/start_uvc_yuv.sh,但是我在/etc/init.d中的的rcS中加入
/etc/rc.d/init.d/mjpg_streamer start
echo " " > /dev/tty1
echo "Starting mjpg-streamer..." > /dev/tty1
然后在/etc/rc.d/init.d下创建了mjpg_streamer脚本,写入
#!/bin/sh
base=start_uvc_yuv.sh
# See how we were called.
case "$1" in
start)
/mjpg-streamer/$base
;;
stop)
pid=`/bin/pidof $base`
if [ -n "$pid" ]; then
kill -9 $pid
fi
;;
esac
exit 0
之后我重新启动开发板,start_uvc_yuv.sh脚本并没有运行,而且打印出/mjpg-streamer/start_uvc_yuv.sh: line 30: ./mjpg_streamer: not found
举个例子,例如:每天晚上8点自动删除/root/febhost/dat和/root/febhost/log下的文件。脚本怎样编写?