Im working on writing a bash script to download imgur albums for the purpose or learning bash. I have this much written so far but when I run it i get this output:
Enter the URL of the imgur album you would like to download: imgur.com
./imgur_dl.sh: line 25: Validating: command not found
./imgur_dl.sh: line 26: Getting: command not found
./imgur_dl.sh: line 30: imgur.com: command not found
This is my code so far.
#!/bin/bash
url=""
id=""
get_id(){
echo "Getting Album ID..."
local url=$1
echo $url
echo "Successflly got Album ID..."
return
}
validate_input(){
echo "Validating Input..."
local id=$1
echo $id
echo "Input Validated Successfully..."
return
}
get_input(){
read -p "Enter the URL of the imgur album you would like to download: " url
echo $url
$(validate_input url)
$(get_id url)
return
}
$(get_input)
What am I doing wrong or what am I not getting? I am working on macOS it that helps at all.