Say, I have a command in bashrc alias which might require variable arguments/parameters. I was able to write it using if else as follows
yd(){
if (( $# )) && (( $1 == 1 ));
then
youtube-dl -f 18 "$2" && aplay /usr/share/sounds/ubuntu/stereo/message.ogg && notify-send 'Youtube Download Completed !'
fi
if (( $# )) && (( $1 == 2 ));
then
youtube-dl -f "$2" "$3" && aplay /usr/share/sounds/ubuntu/stereo/message.ogg && notify-send 'Youtube Download Completed !'
fi
}
Where 1st parameter represents the number of parameters I need. I want to know if there is a way to send variable number of parameters to the alias