fish-shell/sphinx_doc_src/cmds/eval.rst
David Adam 02d82dcf85 docs: update all command synopsis formatting
Adds synopses for those commands missing them.

Moves all synopsis sections to code blocks. This improves the appearance, although highlighting as
fish code may not be the ideal appearance.
2019-09-17 17:59:04 +08:00

34 lines
729 B
ReStructuredText

.. _cmd-eval:
eval - evaluate the specified commands
======================================
Synopsis
--------
::
eval [COMMANDS...]
Description
-----------
``eval`` evaluates the specified parameters as a command. If more than one parameter is specified, all parameters will be joined using a space character as a separator.
If your command does not need access to stdin, consider using ``source`` instead.
If no piping or other compound shell constructs are required, variable-expansion-as-command, as in ``set cmd ls; $cmd``, is also an option.
Example
-------
The following code will call the ls command and truncate each filename to the first 12 characters.
::
set cmd ls \| cut -c 1-12
eval $cmd