def term_echo(command, nindent=<NUM_LIT:0>, env=None, fpointer=None, cols=<NUM_LIT>):
<EOL>os.environ["<STR_LIT>"] = str(cols)<EOL>command_int = command<EOL>if env:<EOL><INDENT>for var, repl in env.items():<EOL><INDENT>command_int = command_int.replace("<STR_LIT>" + var + "<STR_LIT:}>", repl)<EOL><DEDENT><DEDENT>tokens = command_int.split("<STR_LIT:U+0020>")<EOL>if (platform.system().lower() == "<STR_LIT>") and (tokens[<NUM_LIT:0>].endswith("<STR_LIT>")):<EOL><INDENT>tokens = [sys.executable] + tokens<EOL><DEDENT>proc = subprocess.Popen(tokens, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)<EOL>stdout = proc.communicate()[<NUM_LIT:0>]<EOL>if sys.hexversion >= <NUM_LIT>:<EOL><INDENT>stdout = stdout.decode("<STR_LIT:utf-8>")<EOL><DEDENT>stdout = stdout.split("<STR_LIT:\n>")<EOL>indent = nindent * "<STR_LIT:U+0020>"<EOL>fpointer("<STR_LIT:\n>", dedent=False)<EOL>fpointer("<STR_LIT>".format(indent), dedent=False)<EOL>fpointer("<STR_LIT:\n>", dedent=False)<EOL>fpointer("<STR_LIT>".format(indent, command), dedent=False)<EOL>for line in stdout:<EOL><INDENT>if line.strip():<EOL><INDENT>fpointer(indent + "<STR_LIT:U+0020>" + line.replace("<STR_LIT:\t>", "<STR_LIT:U+0020>") + "<STR_LIT:\n>", dedent=False)<EOL><DEDENT>else:<EOL><INDENT>fpointer("<STR_LIT:\n>", dedent=False)<EOL><DEDENT><DEDENT>fpointer("<STR_LIT:\n>", dedent=False)<EOL>
Print STDOUT resulting from a Bash shell command formatted in reStructuredText.

:param command: Bash shell command
:type  command: string

:param nindent: Indentation level
:type  nindent: integer

:param env: Environment variable replacement dictionary. The Bash
            command is pre-processed and any environment variable
            represented in the full notation (:bash:`${...}`) is replaced.
            The dictionary key is the environment variable name and the
            dictionary value is the replacement value. For example, if
            **command** is :code:`'${PYTHON_CMD} -m "x=5"'` and **env**
            is :code:`{'PYTHON_CMD':'python3'}` the actual command issued
            is :code:`'python3 -m "x=5"'`
:type  env: dictionary

:param fpointer: Output function pointer. Normally is :code:`cog.out` but
                 :code:`print` or other functions can be used for
                 debugging
:type  fpointer: function object

:param cols: Number of columns of output
:type  cols: integer