Bash Database Backup to AWS S3
is there a reason for $(which foo) ?

If foo is in your path, it will be found, if not which will give you an error.

Expressions like command will have a return code, so do not write

if [[ $(command -v "$dependency") = "" ]]


just use

if command -v "$dependency" &gt; /dev/null
then ...