Shell Script Function To download using wget

PHOTO EMBED

Wed Feb 09 2022 12:29:41 GMT+0000 (Coordinated Universal Time)

Saved by @irfan309 #linux #shellscript #function #wget #download

#!/bin/bash
#####################################################################
#Author:Irfan Khan
#Description:this function will used to donwload & move that file to
#desired location
#####################################################################
download(){
    #$url=$1
    wget -cO - https://gist.github.com/chales/11359952/archive/25f48802442b7986070036d214a2a37b8486282d.zip > dbtest.zip
    if [[ -f dbtest.zip ]];
    then
        mv dbtest.zip ./mydb_data
        exit 0
    else
        echo "hey file not moved some thing went wrong.."
    fi
}

download  #calling the function
content_copyCOPY

it will download & mv to the desired Directory