I think here is a solution with explanation:
http://fvue.nl/wiki/Bash:_Why_use_eval_ … pansion%3F<snip>
Might want to check out this before going crazy with eval.
]]>/learned something
So I guess this should work:
#!/bin/bash
track_title="\"a b\""
chapters="--chapters ${track_title}/chapters.txt"
eval mkvmerge -o ${track_title}.mkv \
--title ${track_title} \
$chapters
#!/bin/bash
track_title="a b"
chapters="--chapters \"${track_title}/chapters.txt\""
echo mkvmerge -o "${track_title}.mkv" \
--title "${track_title}" \
$chapters
echo mkvmerge -o "${track_title}.mkv" \
--title "${track_title}" \
--chapters "${track_title}/chapters.txt"
gives me this result:
mkvmerge -o a b.mkv --title a b --chapters "a b/chapters.txt"
mkvmerge -o a b.mkv --title a b --chapters a b/chapters.txt
do you see any mistake?
]]>#!/bin/bash
track_title="a b"
chapters="--chapters \"${track_title}/chapters.txt\""
echo $chapters
echo mkvmerge -o "${track_title}.mkv" \
--title "${track_title}" \
$chapters
mkvmerge -o "${track_title}.mkv" \
--title "${track_title}" \
$chapters
echo mkvmerge -o "${track_title}.mkv" \
--title "${track_title}" \
--chapters "${track_title}/chapters.txt"
mkvmerge -o "${track_title}.mkv" \
--title "${track_title}" \
--chapters "${track_title}/chapters.txt"
It should show you where you get the extra "
]]>i'm trying to mux some audio/movie files into an mvk contrainer, but i have one problem... here is the code:
̣
#!/bin/bash
track_title="a b"
chapters="--chapters \"${track_title}/chapters.txt\""
mkvmerge -o "${track_title}.mkv" \
--title "${track_title}" \
$chapters
mkvmerge -o "${track_title}.mkv" \
--title "${track_title}" \
--chapters "${track_title}/chapters.txt"
The second command works fine, but the first doesn't...
Here's the error:
Fehler: Die Datei '"a' konnte nicht zum Lesen geöffnet werden.
(in english: error: could not open the file "'a')
Does anybody know why this isn't working?
Thank you for your help