Re: Command substitution into argument to convert

Lewis <[email protected]>
Newsgroups alt.comp.lang.shell.unix.bourne-bash
Organization Miskatonic U
Message-ID <[email protected]>
In message <[email protected]> Lewis <[email protected]> wrote:
> $ MYDATE=$(date +"%m/%d %H:%M");convert -pointsize 20 -fill black -draw "text 10,20 \"$MYDATE\"" RadarMap.png Stamped.png

This works:

MYDATE=$(date +"%m/%d %H:%M");convert -pointsize 20 -fill white -draw "text 10,20 \"$MYDATE\"" image.jpg image-date.jpg

I expect this also works, but did not try:
convert -pointsize 20 -fill white -draw "text 10,20 \"$(date +"%m/%d %H:%M")\"" image.jpg image-date.jpg

This SHOULD work because the $() should protect the "" inside...

(of course, this draws white text no matter what, which is fine if the
image is dark, but invisible if the top left is white).

-- 
The "H" in Jesus H Christ comes from "Harold be Thy name" in the
	Lord's Prayer.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.