Fish shell 中的 source 命令

EAG*_*GER 2 linux fish

该命令在 Fish 终端中运行良好:

source ~/.config/fish/config.fish
Run Code Online (Sandbox Code Playgroud)

这是config.fish中相关的fish函数

function sf
  command source ~/.config/fish/config.fish
end

Run Code Online (Sandbox Code Playgroud)

当我运行它时,我收到此错误:

Command 'source' not found, did you mean:

  command 'gource' from deb gource (0.51-1build1)

Try: sudo apt install <deb name>

~/.config/fish/config.fish (line 59): 
  command source ~/.config/fish/config.fish
          ^
in function 'sf'
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏!

fah*_*aho 5

source不是外部命令- 没有 /usr/bin/source 可以执行。不可能,因为source需要能够改变当前 shell的环境,所以它必须是内置的。

只需离开command.