我刚刚开始使用fish
。我之前使用过zsh
和bash
。我应该将配置放在 fish
中的什么位置?
配置示例-https://bpaste.net/show/92f553c9aab8
我在~/config/fish/config.fish
中尝试过,但它给了我错误。我得到的错误:https://bpaste.net/show/e136cc91f188
将 &&
替换为 ;
可消除错误。但它做同样的事情吗?如果不是,我怎样才能达到与 &&
相同的效果。
等于错误:
$ iitpi conda update --all
Unsupported use of '='. To run 'https_proxy=http://10.10.78.21:3128' with a modified environment, please use 'env http_proxy=http://10.10.78.21:3128 https_proxy=http://10.10.78.21:3128…'
in function “iitpi”
called on standard input
with parameter list “conda update --all”
最佳答案
其中有一些错误。 Fish 的语法与 zsh 和 bash 不同
不是这个:
alias ipy="(jupyter qtconsole &)"
在 fish 中(...)
是命令替换语法,例如 zsh/bash 反引号或 $(...)
。这样做:
function ipy
jupyter qtconsole &
end
因为 fish 别名只是函数的语法糖
在 bash 中,(...)
在子 shell 中运行内容。如果你真的想在 fish 身上做到这一点,你必须明确:
function ipy
fish -c 'jupyter qtconsole' &
end
<小时/>
&&
是bash; and
命令是fish,所以不是这个:
command1 && command2_if_cmd1_succeeds
但是这个
command1; and command2_if_cmd1_succeeds
关于linux - fish 中的配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39930834/