linux - Fish shell 中的 source 命令

标签 linux fish

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

source ~/.config/fish/config.fish

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

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

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

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'

感谢任何帮助!

最佳答案

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

只需省略命令即可。

关于linux - Fish shell 中的 source 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62751979/

相关文章:

无法将 UNIX/Linux 程序编译为 32 位程序

python - pyenv 在激活虚拟环境时不再正确设置路径

c - OpenWrt LibUbi 实现

c - 使用 dup() 创建重复文件描述符和创建硬链接(hard link)之间的区别?

fish - fish shell 中的 for 循环最多只能执行 3 次

function - 如何从fishshell中删除函数而不直接删除函数文件?

interpolation - Fish shell - 如何插入子命令?

fish shell ;将配置导入主配置

linux - Android studio 未在 Elementary OS (Freya) 中启动

html - Raspberry 在后台打开网页