저는 macOS Catalina
와 Nix를 사용하고 있습니다 2.3.12
.
bash
(Nix를 통해) 최신 버전으로 업데이트 중입니다 . 성공적으로 설치할 수 있고 설치된 Nix 버전이 로드되지만 Bash(최신 버전)에서 기능을 사용하려고 하면 소스 코드를 5.x
제외하고는 사용할 수 없습니다. 이는 다시 Nix 소스 코드입니다..bashrc
내 소스 .bashrc
( .bash_profile
이 콘텐츠만):
#
# ~/.bash_profile
#
[ -f "${HOME}/.bashrc" ] && . "${HOME}/.bashrc"
이 문제가 발생하기 전에 업데이트된 버전을 로드할 수 있는 방법이 있나요?
/etc/shells
파일을 새 bash
위치로 업데이트하고 시도해 도 chsh -s /Users/x80486/.nix-profile/bin/bash
작동하지 않습니다.
.bashrc
내 파일의 내용은 다음과 같습니다.
#
# ~/.bashrc
#
# If not running interactively, don't do anything
# -------------------------------------------------------------------------------------------------
[[ $- != *i* ]] && return
# Aliases
# -------------------------------------------------------------------------------------------------
[ -f "${HOME}/.bash_aliases" ] && . "${HOME}/.bash_aliases"
# Check the window size after each command and, if necessary, update the
# values of LINES and COLUMNS
# -------------------------------------------------------------------------------------------------
shopt -s checkwinsize
# Append to the history file, don't overwrite it
# -------------------------------------------------------------------------------------------------
shopt -s histappend
# Prompt customization
# -------------------------------------------------------------------------------------------------
PS1="\[$(tput sgr0)\][\[\033[01;32m\]\u@\h\[$(tput sgr0)\]:\[\033[01;34m\]\w\[$(tput sgr0)\]]$ "
# PS1="[\u@\h \W]$ "
export PS1
# Set default editor
# -------------------------------------------------------------------------------------------------
EDITOR=/usr/bin/nano
export EDITOR
# Set default blocksize for ls, df, du
# -------------------------------------------------------------------------------------------------
BLOCKSIZE=1k
export BLOCKSIZE
# Do not log repeated identical commands
# -------------------------------------------------------------------------------------------------
HISTCONTROL=ignoreboth:erasedups
export HISTCONTROL
# Increase/Set history limit (100 KB or 5000 entries)
# -------------------------------------------------------------------------------------------------
HISTFILESIZE=100000
export HISTFILESIZE
HISTSIZE=100
export HISTSIZE
# Erlang
# -------------------------------------------------------------------------------------------------
# export ERL_AFLAGS="+pc unicode -kernel shell_history enabled"
# Golang
# -------------------------------------------------------------------------------------------------
GOPATH="${HOME}/.cache/go-path"
export GOPATH
[ ! -d "${HOME}/.cache/go-path" ] && mkdir --parents "${HOME}/.cache/go-path"
PATH="${PATH}:${GOPATH}/bin"
# Nix Package Manager
# -------------------------------------------------------------------------------------------------
BASH_COMPLETION_COMPAT_DIR="${HOME}/.nix-profile/etc/bash_completion.d"
export BASH_COMPLETION_COMPAT_DIR
XDG_DATA_DIRS="${HOME}/.nix-profile/share:${XDG_DATA_DIRS}"
export XDG_DATA_DIRS
[ -f "${HOME}/.nix-profile/etc/profile.d/nix.sh" ] && . "${HOME}/.nix-profile/etc/profile.d/nix.sh"
[ -f "${HOME}/.nix-profile/etc/profile.d/bash_completion.sh" ] && . "${HOME}/.nix-profile/etc/profile.d/bash_completion.sh"
[ -f "${HOME}/.nix-profile/etc/bash_completion.d/git-completion.bash" ] && . "${HOME}/.nix-profile/etc/bash_completion.d/git-completion.bash"
[ -f "${HOME}/.nix-profile/share/bash-completion/completions/gradle" ] && . "${HOME}/.nix-profile/share/bash-completion/completions/gradle"
# Playground Area
# -------------------------------------------------------------------------------------------------
# ASDF
# -------------------------------------------------------------------------------------------------
[ -f "${HOME}/.asdf/asdf.sh" ] && . "${HOME}/.asdf/asdf.sh"
[ -f "${HOME}/.asdf/completions/asdf.bash" ] && . "${HOME}/.asdf/completions/asdf.bash"
export PATH