3 ms·
I wish there was a solution for something like Download(file.gz) and that gets converted to either a wget or curl based on what the system has.
by evnix 2y ago
I wish there was a solution for something like
Download(file.gz)
and that gets converted to either a wget or curl based on what the system has.
- sgarland 2y agodl_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.