3 ms·
dl_tool=$(command -v curl || command -v wget) if [[ ${dl_tool} == *curl* ]]; then dl_cmd="${dl_tool} -sLO $1" elif [[ ${dl_tool} == *wget* ]]; the
by sgarland 2y ago
dl_tool=$(command -v curl || command -v wget)
if [[ ${dl_tool} == *curl* ]]; then
dl_cmd="${dl_tool} -sLO $1"
elif [[ ${dl_tool} == *wget* ]]; then
dl_cmd="${dl_tool} -q $1"
else
printf "%s\n" "ERROR: curl and wget not available, exiting"
fi
Can easily be turned into a function.