From this question I am able to get a wget url for the oracle jdk. I intend to use it in a script vis
wget_opts="-c --no-check-certificate --no-cookies --header --load-cookies="Cookie: oraclelicense=accept-securebackup-cookie""
jdk_download_url="http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz"
/usr/bin/wget $wget_opts $jdk_download_url
When I echo the above command it appears ok and is able to correctly download the file. But on running the command in the script I get the below
--2014-06-04 14:19:43-- http://oraclelicense=accept-securebackup-cookie%22/
Resolving oraclelicense=accept-securebackup-cookie"... failed: Name or service not known.
wget: unable to resolve host address “oraclelicense=accept-securebackup-cookie"”
--2014-06-04 14:20:03-- http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz
Resolving download.oracle.com...
Wget gets the wrong URL.
How do I correct this?