繁体   English   中英

在鱼壳中启用 redhats devtoolset

[英]Enable redhats devtoolset in fish shell

是否有适当的方法在启动时启用鱼壳中的 devtoolset 或任何 rh 工具? 通常在 Zsh (~/.zshrc)或 Bash (~/.bashrc) 中,您会添加类似于以下内容的行:

source /opt/rh/devtoolset-7/enable

或者

source scl_source enable devtoolset-7

不幸的是,这些都没有在 ~/.config/fish/config.fish 中工作,因为fish 不支持该语法。 我知道怎么做的唯一方法是手动将启用文件中的所有行添加到我的鱼路径中。

我刚刚找到了一种方法来做到这一点。 关键是使用第三方工具,允许fish-shell source命令读取bash脚本。 我用低音

安装bass后,您可以简单地使用bass source scl_source enable devtoolset-7来更改gcc版本。 您也可以将其添加到~/.config/fish/config.fish以便每次登录时生效。

更多讨论 在这里

您可以在 /etc/fish/config.fish 中添加命令

# Put system-wide fish configuration entries here
# or in .fish files in conf.d/
# Files in conf.d can be overridden by the user
# by files with the same name in $XDG_CONFIG_HOME/fish/conf.d

# This file is run by all fish instances.
# To include configuration only for login shells, use
# if status --is-login
#    ...
# end
# To include configuration only for interactive shells, use
# if status --is-interactive
#   ...
# end
source scl_source enable rh-git29
source scl_source enable rh-postgresql10

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM