EXPORT(1)
π EXPORT(1) β fish-shell
okay so bestie, buckle in, because this one's a whole thing and it's literally from the fish-shell manual, page EXPORT(1). no cap. πβ¨
πΈ NAME πΈ
export β the compatibility function for exporting variables π
β¨ SYNOPSIS β¨
export
export NAME=VALUE
π DESCRIPTION π
export is a function that's included purely for compatibility with POSIX shells β it's the friendly little bridge for when you're coming from bash-land. but like, in general? the set <> builtin should be used instead. that's the main character here, export is just the guest star. π
So when you call export with no arguments, it prints out a list of all the currently-exported variables β exactly like set -x does. cute little lineup. π
When you call it with a NAME=VALUE pair, the variable NAME gets set to VALUE in the global scope, and it's exported as an environment variable so all your other commands can see it. sharing is caring fr fr π«Ά
and options? there are no options available. none. zero. that's it. π
π¦ EXAMPLE π¦
The following commands have an identical effect β like, literally the same outcome:
set -gx PAGER bat
export PAGER=bat
β οΈ Note: if you wanna add to something like$PATH, you need to be careful to combine the list<#cartesian-product>. quote it, like so:
export PATH="$PATH:/opt/bin"
Or just use set, which avoids this whole situation entirely, no drama:
set -gx PATH $PATH /opt/bin
β SEE MORE β
- The
set <>command. (go read it, it's iconic, iykyk π)
π Copyright π
fish-shell developers π
okay that's the whole page bestie, you ate that πβ¨ β this was fish-shell 4.9, dated Sep 08, 2026, and that's the vibe check, periodt. π π
π¦ where this page comes from
- arch rolling: fish 4.9.3-1 Β· GPL-2.0-only AND BSD-3-Clause AND ISC AND MIT AND PSF-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms