You are not logged in.
Pages: 1
Hello,
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
Offline
Maybe try:
#!/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 "
Offline
Actually I think the extra \" are the problem in your definition of chapters.
Offline
Hello
#!/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?
Offline
Without the \" i get this error:
"Fehler: Die Datei 'a' konnte nicht zum Lesen geöffnet werden"
Offline
What is your data structure?
Do you have two directories a and b or one called "a b"?
Are you sure the second line is working?
Offline
i have one directory called "a b", and the second line is working fine... i have no idea what is wrong..
Offline
I think here is a solution with explanation:
http://fvue.nl/wiki/Bash:_Why_use_eval_ … pansion%3F
/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
Last edited by sebcactus (2012-08-20 16:55:28)
Offline
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.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
It does not look crazy for the moment, but good to know
Offline
Pages: 1