Bash script set command to a variable

Hi,

Will following set up work in bash script? I've got errors if assigning following binary command to a variable. But on the other hand, COMMAND="ls" works. Any explanation please? How can I assign binary command to a variable COMMAND then I can just call ${COMMAND}?

COMMAND="rsync"
SSH="ssh"

${COMMAND} -vaz -e "${SSH} .....

Thank you.

Kind regards.

What is the error message?

Are you using the correct options in the command?

The error was could not find rsync and ssh, but if I use rsync and ssh directly in the statement, it works fine.

Thanks.

Kind regards.

Locate the path name for these binaries using which and use absolute path of these binaries in your script.