我在shell脚本的循环中运行Perl脚本:
while [ $currentDate -le $toDate ]; do
// code here...
exec /users/my_user/script_name $currentDate
// code here...
done
Run Code Online (Sandbox Code Playgroud)
我已经确认了while-loop
循环.但是,在运行一次Perl脚本之后,while-loop
结束了.
有人可以对此有所了解吗?
nan*_*dhp 11
你正在使用exec
.exec
用新程序替换shell进程.您可能只想删除exec
关键字.
exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
用给定的命令替换shell.
执行
COMMAND
,用指定的程序替换此shell.ARGUMENTS
成为争论的焦点COMMAND
.