Can anybody help to solve this. I want to parse some xmldata along with the URL in the Shell.
I'm calling the URL via the curl command
Given below is my shell script file
export url="http://localhost/test/apirequest.php?&apikey=Zm9ybSRAMCMjMjAxMy0wMS0wMyAxNDo0MjoyNg==&reqtype=xml&operation=insertRecords&xmldata=<?xml"\ "version="1.0" encoding="iso-8859-1"?><root><FORM name ="Form1"><row no="0"><FL val="Company">New Company2</FL></row></FORM></root>"
script=$(curl -s "$url")
printf "%s\nDo you want to run this script? [yN]" "$script"
read line
case $line in
[Yy]|[Yy][Ee][Ss])
sh <<EOF
$script
EOF
esac
The script goal is to �?
As far as I get, your script stores into a variable "script" the result of the curl execution "curl -s "$url" "and then executes that result.+
So, what error do you get?
Is that the purpose of your script?
Can you tell what is the return value of the curl execution?
Here the url is getting breaked due the space between the strings xml version .And the same prob happens , whevener there is same some in between the strings.