I try porting linux setup script to windows. In script I have file download like
ASL_DISTRO_SITE=surfnet.dl.sourceforge.net
BOOST_NAME=boost_1_44_0
BOOST_VERSION=1.44.0
if [ ! -e $BOOST_DISTRO_NAME ]; then
echo_run ${CURL_CMD} http://$ASL_DISTRO_SITE/project/boost/boost/$BOOST_VERSION/$BOOST_DISTRO_NAME -o $BOOST_DISTRO_NAME
fi
How to port such part of script to windows .bat language? Are there any utils coming from MS by default?
There seem to be a couple of missing items in the code you provide, but here is a best guess of how to proceed:
I don’t have an easy way to test this, so if it doesn’t work, remove the open and close parens and the continuation char ‘^’, and put all of the
%CURL_CMD% ...command on the same line as theif NOT EXISTS ....So, you need to provide values for BOOST_BASE_DIR (which I have added as a var to the script), BOOST_DISTRO_NAME, CURL_CMD …. AND … you need to find out if you need
echo_run, I don’t think so. Forecho_run, you have to look at your original script. I would guess that this is a function defined, and that is uses theeval. If that is true, the above may not work. Make a bat file without the IF NOT test, but with the all theset ...variables, and the%CURL_CMD%, run it and then add the output of the failure to you question above 😉I hope this helps.