fish script set variable

C++
# Setting a normal variable
set varname "variable"

# Setting a variable as a result from a command
set varname (command)
Source

Also in C++: