I have the following code as part of a larger file (assume ${tools_urls}
, ${tempFolder}
are global variables)
download_tools()
{
for i in ${tools_urls}; do
wget --no-check-certificate --directory-prefix=${tempFolder} ${i} || { echo "download failed" ; exit 3}
done
}
When I run the script, I get the following error:
syntax error near unexpected token 'done'
However, if I remove the || { echo "download failed" ; exit 3}
part of the loop, it works.
Why is this the case? I can't see anything wrong with my code, and I can't find similar examples that involve multiple statements in one line