Instead of using a variable to hold the pathname for the mysql program, from a which(1) call, hardcode its name in the variable, and then use «command -v» to check whether the command exists and abort otherwise. The pattern of assigning the result of which(1) into a variable is both redundant and unsafe, because the shell already looks for the command on the PATH, and if which(1) cannot find it then we are then executing the command unconditionally where we end up calling the first argument as if it was an actual command, which can be dangerous. Change-Id: I6c31e03b8b20fe037869f2f41954f5ed268434camaster
parent
87c429f4a3
commit
acb0942903
Loading…
Reference in new issue