Shell script problem

Ian Coetzee ubuntu at iancoetzee.za.net
Mon Mar 1 17:22:42 UTC 2010


On 2010/03/01 06:19 PM, James Kaufman wrote:

<snip, hope its not too much :) >
> This doesn't look right to me:
>
> for file in $FILES ; do
>       echo "Going to execute command $joinCommand"
>       joinCommand="$joinCommand $file"
> done
>    
No actually it is right. Look at the cmd very carefully

It will just append the file to the end of the command, every turn it 
executes it rewrites "joinCommand" with "$joinCommand" + next file.

I just had a random thought, what happens when you just execute the 
command alone, without all this mucking about in a script?

try "mencoder -oac copy -ovc copy -o joined-output.avi <file1> <file2>" 
replacing either <file1> or <file2> with the file that fails 
(/home/vijay/downloads/Reservoir/Reservoir.avi)

Tell us how it goes.

Regards
Ian

PS: did you write that script self, or downloaded it?
> If you are joining two files, A and B, that command will do something
> like this:
>
> mencoder -oac copy -ovc copy -o OUTPUT A mencoder -oac copy -ovc copy -o
> OUTPUT B
>
> Perhaps I am wrong. One thing you can try is to run your shell command
> like this:
>
> sh -x ./join_files.sh
>
> Then the shell will echo each line it executes so you can easily trace
> what it is doing.
>
>
>
>
>
>    




More information about the ubuntu-users mailing list