I could not find the exact reference to what I'm doing...
I have the following script that does not expand the variable inside the command:
#!/bin/bash
name="my name"
`convert -pointsize 250 -font /usr/share/fonts/truetype/msttcorefonts/impact.ttf -fill black -draw 'text 330,900 "$name"' tag.jpg name_my.jpg`
This results in an image that has the text $name instead of the content of name.
I actually need to read lines from a file and rund the command on each name so my real script is(has the same problem):
arr=(`cat names.txt`)
for (( i=0; i<${len}; i+=2 ));
do
`convert -pointsize 250 -font /usr/share/fonts/truetype/msttcorefonts/impact.ttf -fill black -draw 'text 330,900 "$(${arr[i]} ${arr[i+1]})"' tag.jpg name_${arr[i]}.jpg`
done