should be

result=$(type $command 2>/dev/null 1>/dev/null);