.\" Man page generated from reStructuredText .\" by the Docutils 0.23 manpage writer. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "EXPORT" "1" "Oct 26, 2026" "4.9" "fish-shell" .SH NAME export \- compatibility function for exporting variables .SH SYNOPSIS .nf \fBexport\fP \fBexport\fP \fINAME\fP\fB=\fP\fIVALUE\fP .fi .sp .SH DESCRIPTION .sp \fBexport\fP is a function included for compatibility with POSIX shells. In general, the set \%<> builtin should be used instead. .sp When called without arguments, \fBexport\fP prints a list of currently\-exported variables, like \fBset \-x\fP\&. .sp When called with a \fBNAME=VALUE\fP pair, the variable \fBNAME\fP is set to \fBVALUE\fP in the global scope, and exported as an environment variable to other commands. .sp There are no options available. .SH EXAMPLE .sp The following commands have an identical effect. .INDENT 0.0 .INDENT 3.5 .sp .EX set \-gx PAGER bat export PAGER=bat .EE .UNINDENT .UNINDENT .sp Note: If you want to add to e.g. \fB$PATH\fP, you need to be careful to combine the list \%<#\:cartesian-product>\&. Quote it, like so: .INDENT 0.0 .INDENT 3.5 .sp .EX export PATH=\(dq$PATH:/opt/bin\(dq .EE .UNINDENT .UNINDENT .sp Or just use \fBset\fP, which avoids this: .INDENT 0.0 .INDENT 3.5 .sp .EX set \-gx PATH $PATH /opt/bin .EE .UNINDENT .UNINDENT .SH SEE MORE .INDENT 0.0 .IP 1. 3 The set \%<> command. .UNINDENT .SH Copyright fish-shell developers .\" End of generated man page.