linux - fish 中的配置

标签 linux shell fish

我刚刚开始使用fish。我之前使用过zshbash。我应该将配置放在 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/

相关文章:

linux - 查找具有可变字符数的文件名

linux - php5-fpm 无法打开文件进行读取

linux - Gfortran 警告提示 "Wmaybe-uninitialized"

linux - 如何直接操作 PWD?

comments - 在 fish shell 函数文件中添加注释

php - UTF-8贯穿始终

shell - 显示状态已取消的 EMR 集群步骤

bash - 将标准输入复制到标准输出

wsl-2 - 在fish中不断设置DISPLAY变量

user-input - 如何在 fish shell 中获得用户确认?