def checkprint(self, cmd, shell=None, nofail=False):
        """
        Just like callprint, but checks output -- so you can get a variable
        in python corresponding to the return value of the command you call.
        This is equivalent to running subprocess.check_output() 
        instead of subprocess.call().
        :param str | Iterable[str] cmd: Bash command(s) to be run.
        :param bool | str shell: If command requires should be run in its own shell. Optional.
            Default: "guess" -- `run()` will try to guess if the command should be run in a
            shell (based on the presence of a pipe (|) or redirect (>), To force a process to
            run as a direct subprocess, set `shell` to False; to force a shell, set True.
        :param bool nofail: Should the pipeline bail on a nonzero return from a process? Default: False
            Nofail can be used to implement non-essential parts of the pipeline; if these processes fail,
            they will not cause the pipeline to bail out.
        """

        self._report_command(cmd)

        likely_shell = check_shell(cmd, shell)

        if shell is None:
            shell = likely_shell

        if not shell:
            if likely_shell:
                print("Should this command run in a shell instead of directly in a subprocess?")
            cmd = shlex.split(cmd)
            
        try:
            return subprocess.check_output(cmd, shell=shell)
        except Exception as e:
            self._triage_error(e, nofail)