public static function detectCmdLocationWithWhich($cmd) : string
    {
        $bin = '';
        // on nx systems use 'which' command.
        if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
            $command = trim(`which $cmd`);
            $bin     = self::getExecutable($command);
        }
        return $bin;

    }
public static function detectCmdLocationWithWhich($cmd) : string
    {
        $bin = '';
        // on nx systems use 'which' command.
        if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
            $command = trim(`which $cmd`);
            $bin     = self::getExecutable($command);
        }
        return $bin;

    }
public static function detectCmdLocationWithWhich ( $ cmd ) : string { $ bin = '' ; // on nx systems use 'which' command. if ( ! defined ( 'PHP_WINDOWS_VERSION_BUILD' ) ) { $ command = trim ( `which $cmd` ) ; $ bin = self :: getExecutable ( $ command ) ; } return $ bin ; }
Detect command location using which cli command.

@param  string $cmd
@return string
Detect command location using which cli command .