Shell script problem

Vijay Shanker Dubey vijay.shad at gmail.com
Tue Mar 2 04:28:56 UTC 2010


Regards,
Vijay Shanker Dubey



On Mon, Mar 1, 2010 at 10:52 PM, Ian Coetzee <ubuntu at iancoetzee.za.net>wrote:

> 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
>
>
Yes it is right But I have some issues. Even if the FILES array has three
file locations but at the end only first location is added to join command.
do you see any particular error for this.

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)
>
> The command works like charm. I used it before. But i thought to give shell
scripts a try and decided to create s script for this task. I wish to create
a simple application with simple UI to join two files and this it the first
step towards the process. :)

> Tell us how it goes.
>
> Regards
> Ian
>
> PS: did you write that script self, or downloaded it?
>


Well, This is whole my own creation, AND my second shell script.


> > 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.
> >
> >
> >
> >
> >
> >
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100302/1b195c10/attachment.html>


More information about the ubuntu-users mailing list