EVAL(1) fish-shell EVAL(1)

# [NAME](#NAME)

eval - evaluate the specified commands

# [SYNOPSIS](#SYNOPSIS)

```
eval [COMMANDS ...]
```

# [DESCRIPTION](#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 source &lt;&gt; 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](#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
```

# [Copyright](#Copyright)

fish-shell developers

October 10, 2026 4.9

---

Document: eval(1) from fish 4.9.3-r1 (Chainguard OS)
Source: https://github.com/fish-shell/fish-shell
