On Mon, May 30, 2005 at 12:42:52AM -0700, m ike wrote:
>this
>
>  convert  -draw "line 10,10,20,20"  text.jpg out.jpg
>
>draws a line on the image from 10,10 to 20,20 
>
>so does this:
>
>  g="line 10,10,20,20"
>  convert -draw "$g"  text.jpg out.jpg
>
>but this chokes:
>
>  g='-draw "line 10,10,20,20"'
>  echo $g
>  convert $g text.jpg out.jpg
>
>appearantly convert is seeing "line 10,10,20,20" as two 
>arguments, divided at the space.

probably, you could try experimenting with IFS (man bash) to get a
better understanding, but I doubt you will want to change that, for your
own sanity.

On what you wrote, I can't tell why you want to do this. But, I imaging
the use of a function to wrap convert will get you their more easily.

myconvert () {
case $1 in
        line)
                convert -draw "$1 $2,$3,$4,$5" /dev/stdin /dev/stdout
        ;;
        *)
                echo "I can't do $@" >/dev/stderr
                return 1
        ;;
esac

myconvert line $a $b $c $d <somefile.jpg >out.jpg

(untested)

// George


-- 
George Georgalis, systems architect, administrator Linux BSD IXOYE
http://galis.org/george/ cell:646-331-2027 mailto:[EMAIL PROTECTED]


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to