mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-25 12:21:14 -03:00
No need to define "cmd-foo" anchors; use :doc:`foo <cmds/foo>`
instead. If we want "cmd-foo" but it should be tested.
See also 38b24c2325 (docs: Use :doc: role when linking to commands,
2022-09-23).
30 lines
738 B
ReStructuredText
30 lines
738 B
ReStructuredText
eval - evaluate the specified commands
|
|
======================================
|
|
|
|
Synopsis
|
|
--------
|
|
|
|
.. 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 :doc:`source <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
|
|
|