mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-15 22:44:01 +00:00
ad4530acd3
This matches the style in man(1) (except that we use the … ligature). A previous iteration did the reverse (never use a space before the ellipsis). That would be a smaller change.
29 lines
744 B
ReStructuredText
29 lines
744 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 the command does not need access to stdin, consider using :ref:`source <cmd-source>` instead.
|
|
|
|
If no piping or other compound shell constructs are required, variable-expansion-as-command, as in ``set cmd ls -la; $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
|
|
|