make在我的脚本中添加“ exec”行 [英] make adds an 'exec' line to my scripts

查看:100
本文介绍了make在我的脚本中添加“ exec”行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个perl软件包(模块+脚本)。

I'm trying to build a perl package (module + scripts).

我的Makefile.PL包含以下内容来包含我的脚本

My Makefile.PL has the following to include my script

EXE_FILES => [
               'bin/somescript1',
             ],

脚本,它将以下内容添加到已安装脚本的开头。

But after installing the script, it adds the following to the beginning of the installed script.

eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
    if 0; # not running under some shell

为什么这样做,我可以使其不包括吗?

Why does it do this and can I make it not include that?

推荐答案

当ExtUtils :: Makemaker安装脚本时,它会修改为shebang行以使用 perl 您过去用来构建发行版。这样,当您调用脚本时,它会使用与安装依赖项相同的 perl

When ExtUtils::Makemaker installs your scripts, it modifies to the shebang line to use the path to the perl you used to build the distribution. That way, when you call the script, it uses the same perl that you used to install the dependencies.

此外,它添加了 exec 行。如果由于某种原因,系统在shell中而不是 perl 中启动程序,则 exec 会将其切换为 perl

Additionally, it adds that exec line. If, for some reason, the system starts your program in the shell instead of perl, the exec switches it to perl.

别管它。这只会帮助您。

Leave it alone. This only helps you.

但是,如果要覆盖它,则必须覆盖Makemaker安装程序的部分。如果您想切断手臂,就必须自己去做。全部都在Makemaker文档中。

However, if you want to override it, you have to override the parts of Makemaker that install programs. If you want to cut off your arm, you'll have to find out how to do that yourself. It's all in the Makemaker docs.

这篇关于make在我的脚本中添加“ exec”行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆