簡體   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