Linux bash为pdfunite提供了参数 [英] Linux bash provide arguments to pdfunite

查看:365
本文介绍了Linux bash为pdfunite提供了参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨论坛,



a bash脚本我写的行为出乎意料(读:它有一个错误。)我只是不明白。



假设有变量 PAGES ,其中包含page0.pdf page1.pdf page2。 PDF。还有 $ 1 ,其中包含result.pdf



我想将所有这些单页pdf文件合并为一个多页pdf文件。那里有 pdfunite 。代码片段的第一行打印到屏幕脚本尝试执行的内容,第二行就是这样(或者我认为)。

 echo pdfunite$ PAGES$ 1
pdfunite$ PAGES$ 1

此时, pdfunite 打印其帮助消息。因此我猜我给它的参数有问题。

但是当我将第一行的输出复制到脚本运行的终端的命令提示符时,它 pdfunite 一切都很完美。



所以:执行某些东西(不起作用)的区别在于将它打印到控制台并将其复制到一个新线上执行(哪个有效)?



我尝试过:



在实际执行之前将有问题的命令打印到控制台。并尝试执行打印出来的版本(实际上有效)。

解决方案

1 其中包含结果.pdf



我想将所有这些单页pdf文件合并为一个多页pdf文件。那里有 pdfunite 。代码片段的第一行在屏幕上打印脚本尝试执行的内容,第二行就是这样(或者我认为)。

 echo pdfunite


< blockquote> PAGES


1
pdfunite


Hi forum,

a bash script I wrote behaves unexpectedly (read: "There's a bug in it.") and I just don't get it.

Say there's that variable PAGES which contains " page0.pdf page1.pdf page2.pdf". And there is $1 which contains "result.pdf".

I want to merge all those single-page pdf files into one multi-page pdf file. There's pdfunite for that. The first line of the code snippet prints to the screen what the script is trying to execute, the second line does just that (or so I thought).

echo pdfunite "$PAGES" "$1"
pdfunite "$PAGES" "$1"

At that point, pdfunite prints its help message. Therefore I guess that something is wrong with the arguments I gave it.
But when I copy the output of the first line to the command prompt of the very terminal the script ran in, it pdfunites everything together perfectly.

So: Where's the difference in executing something (which does not work) to printing it to the console and copying it onto a new line to execute (which does work)?

What I have tried:

Printed the command in question to the console before actually executing it. And tried to execute the printed-out version (which actually works).

解决方案

1 which contains "result.pdf".

I want to merge all those single-page pdf files into one multi-page pdf file. There's pdfunite for that. The first line of the code snippet prints to the screen what the script is trying to execute, the second line does just that (or so I thought).

echo pdfunite "


PAGES" "


1" pdfunite "


这篇关于Linux bash为pdfunite提供了参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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