红联Linux门户
Linux帮助

请教一个shell中exec的问题

发布时间:2009-02-26 09:37:08来源:红联作者:henryhj
脚本是这样的[code]#!/bin/bash
echo "This line appears ONCE in the script, yet it keeps echoing."
echo "The PID of this instance of the script is still $."
echo "==================== Hit Ctl-C to exit ===================="
sleep 1
exec $0
echo "This line will never echo!"
exit 0
[/code]但是运行出错了,如下的结果……[code]This line appears ONCE in the script, yet it keeps echoing.
The PID of this instance of the script is still 11246.
==================== Hit Ctl-C to exit ====================
exec_daemon1: line 6: exec: exec_daemon1: 未找到
[/code]请达人帮忙解答一下
文章评论

共有 0 条评论