Feio pra caramba, mas funciona:
function foo
echo bar;
end
setenv funcdefs (functions -n | perl -pe 's/,/\n/g' | while read d; functions $d; end|perl -pe 's/\n/function foo
echo bar;
end
setenv funcdefs (functions -n | perl -pe 's/,/\n/g' | while read d; functions $d; end|perl -pe 's/\n/%pre%1/')
perl -e '$ENV{"funcdefs"}=~s/%pre%1/\n/g;system ("fish", "-c", $ENV{funcdefs}."foo")'
1/')
perl -e '$ENV{"funcdefs"}=~s/%pre%1/\n/g;system ("fish", "-c", $ENV{funcdefs}."foo")'