[fish] Set and export an environment variable

Created on November 30, 2026

Use set -x to set a variable and export it to commands started by fish.

set -x GREETING "Hello"

A child process can read the value through its environment.

fish