how to? launch command with string of command line options

my description from another thread...

here's my code:

#!/bin/bash
IFS=$'\n'

function OutputName() {
        input=$1
        echo $input
        input=`echo "$input" | sed -e 's/.[Aa][Vv][Ii]//'`
        input=`echo "$input".avi`
        output_name=$input
}

if [[ -z "@ARGV" ]]; then
        echo "arguements are files to combine"
        exit
else
        if [[ ! -e $1 ]]; then
                echo "no such input video!"
                exit
        else
                first=`find "$1" -printf "%f"`
                echo "Input File Found!: $first"
                shift
        fi
        OutputName $first
        echo "Output video name will be: "$output_name""
        echo
fi

options="--audio-map --force-b-frame --force-unpack --rebuild-index"

appendlist=""

until [ -z "$1" ]
do
#       echo "$1"
#       echo "$appendlist"
        if [[ ! -e $1 ]]; then
                echo "no such input video! $1"
                exit
        else
                filename=`find "$1" -printf '"%f"'`
                appendlist="$appendlist $options --append $filename"
        fi
#       echo "$appendlist"
#       echo
        shift
done

echo "avidemux2_cli --nogui $options --load \"$first\" $appendlist --force-smart --save \"$output_name\" --quit"

thanks for the help!

I didn't read your code too carefully, so I could have missed something, but is there anything wrong with

echo 'some "command" --with options' | sh

You can have your variants, of course.

dhummy=`some "command" --with options`
fnord='some "command" --with options'
eval $fnord

etc etc.

because I get this as the output:

anyone know why this is failing?

requesting help again, thanks!

How exactly did you manage to produce that error message? It looks like you had double-quoted the whole command, where you shouldn't.

If you change it back to echo, doesn't ../combine-0.1 | sh do what you want?