I'm having the following bash script:
URL=`grep -E -m 1 -o "<ExportCatalogResult>(.*)</ExportCatalogResult>" costa_export.xml| sed -e 's,.*<ExportCatalogResult>\([^<]*\)</ExportCatalogResult>.*,\1,g'` && echo $URL echo -n $url > url.txt && wget $(cat url.txt | tr -d " \t\n\r") -O price.zip
The problem is that, when running the script, wget is always downloading an empty file:
http://training.******.net/WAWS_1_9/Catalog/price.zip //echo $URL Resolving training.******.net (training.*******.net)... 194.**.***.90, 194.**.***.90 Connecting to training.******.net (training.*****.net)|194.**.***.90|:80... connected. HTTP request sent, awaiting response... 204 Still exporting Length: 0 Saving to: ‘price.zip’ [ <=> ] 0 --.-K/s in 0s
However, the url that is echoed is a valid one (running a wget with that url in the command line will download the zip package).
Why is this happening?