Forrest logo
back to the set tool

fish:tldr:31393

fish: Define and export an environmental variable that persists across shell restarts (builtin).
$ set --universal --export ${variable_name} ${variable_value}
try on your machine

The command "set" is used to set or change the values of shell options or variables in Unix-like operating systems.

In this specific command:

  • "--universal" is an option that sets the scope of the variable to be universal or global. This means that the variable can be accessed and used by all processes and subshells in the current shell session.

  • "--export" is another option that marks the variable for export. This allows the variable to be inherited by child processes when the shell starts new processes or subshells.

  • ${variable_name} is the name of the variable that you want to set or change. It should be replaced with the actual name of the variable.

  • ${variable_value} is the value that you want to assign to the variable. It should be replaced with the actual value you want to set.

By executing this command, you are effectively setting the value of the specified variable to the provided value and making it accessible and inheritable by child processes.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the set tool