【发布时间】:2016-10-06 03:26:51
【问题描述】:
我需要执行以下命令:
melt color:"#eeeeee" -filter dynamictext:"this text"
"this text" 是来自title.txt 文件的字符串。
我使用这种方法读取文件:
while IFS='' read -r line || [[ -n "$line" ]]; do
echo $line
done < "title.txt"
问题是如何将 bash 循环中的-filter dynamictext:"this text" 设为字符串,然后最终执行:
melt color:"#eeeeee" $string
我使用了这段代码,但到目前为止没有运气:
while IFS='' read -r line || [[ -n "$line" ]]; do
string="$string -filter dynamictext:\"$line\""
done < "title.txt"
融化错误:Failed to load "text"
title.txt 包含:
this text
second text
anothe text
【问题讨论】:
-
转义引用:
"$string -filter dynamictext:\"$line\"" -
谢谢,但不起作用..视频输出:“这并生成错误无法加载“文本””
-
"-filter dynamictext:'$line'"有效吗? (外面用双引号,里面用单引号。) -
不工作,视频输出:'这个,控制台错误:无法加载“文本”
标签: bash mlt melt-framework