fish-shell/share/functions/export.fish
Fabian Homborg 20e96df85d export: Enable values with "=" in them
Only split on the first "=" to achieve this.

Closes #2403
2015-09-24 15:28:58 +02:00

17 lines
520 B
Fish

function export --description 'Set global variable. Alias for set -gx, made for bash compatibility'
if test -z "$argv"
set
return 0
end
for arg in $argv
# Only split on the first =
set -l v (echo $arg | string replace "=" "\n")
set -l c (count $v)
switch $c
case 1
set -gx $v $$v
case 2
set -gx $v[1] $v[2]
end
end
end