I'm trying to pass a variable to sed that contains XML.
From this XML I would like to extract the parts contained between <image_viewer> </image_viewer>
; and <image_thumb_url> </image_thumb_url>
There is an HTML link between each of those tags, which has no spaces; and each tags + link are on a single line.
It seems I'm doining it completely wrong, I'm very new to bash...
base64 -w0 "$1" > "$1".64.jpg
apiXml=$(curl -v -F "upload=<$1.64.jpg" -F key="$apiKey" -F format=xml "$apiUrl")
imgView=$(echo "$apiXml" | sed 's/<image_viewer>\(.*\)<\/image_viewer>/\1/')
imgThumb=$(echo "$apiXml" | sed 's/<image_thumb_url>\(.*\)<\/image_thumb_url>/\1/')
imgLink="[url=$imgView][img]$imgThumb[/img][/url]"
echo "$imgLink"
Any suggestions would be welcome, thanks !