EXPORT(1) fish-shell EXPORT(1)

# [NAME](#NAME)

export - compatibility function for exporting variables

# [SYNOPSIS](#SYNOPSIS)

```
export
export NAME=VALUE
```

# [DESCRIPTION](#DESCRIPTION)

**export** is a function included for compatibility with POSIX shells. In general, the set &lt;&gt; builtin should be used instead.

When called without arguments, **export** prints a list of currently-exported variables, like **set** **-x**.

When called with a **NAME=VALUE** pair, the variable **NAME** is set to **VALUE** in the global scope, and exported as an environment variable to other commands.

There are no options available.

# [EXAMPLE](#EXAMPLE)

The following commands have an identical effect.

```
set -gx PAGER bat
export PAGER=bat
```

Note: If you want to add to e.g. **$PATH**, you need to be careful to combine the list &lt;#cartesian-product&gt;. Quote it, like so:

```
export PATH="$PATH:/opt/bin"
```

Or just use **set**, which avoids this:

```
set -gx PATH $PATH /opt/bin
```

# [SEE MORE](#SEE_MORE)

1\.

The set &lt;&gt; command.

# [Copyright](#Copyright)

fish-shell developers

September 9, 2026 4.9

---

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