function y-dl ($URL) {
cd ~/Music/
youtube-dl -f bestaudio --prefer-ffmpeg --extract-audio --audio-format mp3 $URL > /dev/null 2>&1
}
I'm trying to write a bash function for my bash profile that downloads YouTube Audio without any verbosity in stderr or stdout but I get the following compilation error:
-bash: /Users/mu/.bash_profile: line 11: syntax error near unexpected token `$URL'
-bash: /Users/mu/.bash_profile: line 11: `function y-dl ($URL) {'
I'm trying a variant of the top answer from Passing parameters to a Bash function but I can't get it to work.