加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

循环中的Perl脚本在一次运行后结束

发布时间:2020-12-16 06:09:37 所属栏目:大数据 来源:网络整理
导读:我在 shell脚本的循环中运行Perl脚本: while [ $currentDate -le $toDate ]; do // code here... exec /users/my_user/script_name $currentDate // code here... done 我已经确认了while循环循环.但是,在运行一次Perl脚本之后,while循环结束. 有人可以对此
我在 shell脚本的循环中运行Perl脚本:

while [ $currentDate -le $toDate ]; do
    // code here...
    exec /users/my_user/script_name $currentDate
    // code here...
  done

我已经确认了while循环循环.但是,在运行一次Perl脚本之后,while循环结束.

有人可以对此有所了解吗?

解决方法

你正在使用exec. exec用新程序替换shell进程.您可能只想删除exec关键字.

exec [-cl] [-a name] [command [arguments ...]] [redirection ...]

Replace the shell with the given command.

Execute COMMAND,replacing this shell with the specified program.
ARGUMENTS become the arguments to COMMAND.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读