使用'wkhtmltopdf'工具运行shell脚本时权限被拒绝

问题描述 投票:0回答:1

嗨!因此,我在Ubuntu终端的script中使用wkhtmltopdf工具...

#!/bin/bash
#search for every '*.html' extension and store it in 'output.txt' file 
find /home/guidine/09 -name '*.html' > output.txt
#read 'output.txt' file executing the command 'wkhtmltopdf' syntax for each line
for word in $(cat /home/guidine/bin/output.txt)
do 
    $wkhtmltopfd $word $word".pdf"
done

哪个返回“ output.txt”中的每一行(它是路径),并带有“权限被拒绝”消息(示例为附件,任何人都可以帮我吗?

Screenshot of output

我已经做过$ chmod +x wkhtmltopdf.sh

[我找到了让我满意的替代方法,并且我正在解决问题。

find <directory> -name '*.html' -exec wkhtmltopdf {} {}.pdf \;
bash shell wkhtmltopdf permission-denied
1个回答
0
投票

[我找到了让我满意的替代方法,并且我正在解决问题。

find <directory> -name '*.html' -exec wkhtmltopdf {} {}.pdf \;
© www.soinside.com 2019 - 2024. All rights reserved.