Double entry in PATH. How to remove?
by ddenial from LinuxQuestions.org on (#58Q84)
Hello all,
Distro: Fedora 32
I'm getting double-entry of my custom PATH from .bashrc file.?
This is my .bashrc file and custom paths are /dc/code/bash and /dc/code/py.
Code:# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
export LIBVIRT_DEFAULT_URI=qemu:///system
export PATH=$PATH:/dc/code/bash:/dc/code/pyThis is the result with double entry:
Code:atom@fedy ~]$ echo $PATH
/home/atom/.local/bin:/home/atom/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/dc/code/bash:/dc/code/py:/dc/code/bash:/dc/code/pyIn /etc/bashrc, I have this added:
Code:# Shell Options
# =============
shopt -q -s dotglob
set -o noclobber
# Terminal font colors
# ====================
LS_COLORS=$LS_COLORS:'di=1;34:' ; export LS_COLORS
# Global variables
# ================
export CDPATH=/var/lib/libvirt:/dc/code
# Aliases
# =======
alias ll='ls -lh'
alias vi=vim
alias cp='cp -vi'
alias mv='mv -vi'
alias sudo='sudo '
alias pings='ping -c4 google.com'
alias nh='sudo nethogs enp3s0'
alias reboot='systemctl reboot'
alias poweroff='systemctl poweroff'What is going wrong?
Thanks


Distro: Fedora 32
I'm getting double-entry of my custom PATH from .bashrc file.?
This is my .bashrc file and custom paths are /dc/code/bash and /dc/code/py.
Code:# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
export LIBVIRT_DEFAULT_URI=qemu:///system
export PATH=$PATH:/dc/code/bash:/dc/code/pyThis is the result with double entry:
Code:atom@fedy ~]$ echo $PATH
/home/atom/.local/bin:/home/atom/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/dc/code/bash:/dc/code/py:/dc/code/bash:/dc/code/pyIn /etc/bashrc, I have this added:
Code:# Shell Options
# =============
shopt -q -s dotglob
set -o noclobber
# Terminal font colors
# ====================
LS_COLORS=$LS_COLORS:'di=1;34:' ; export LS_COLORS
# Global variables
# ================
export CDPATH=/var/lib/libvirt:/dc/code
# Aliases
# =======
alias ll='ls -lh'
alias vi=vim
alias cp='cp -vi'
alias mv='mv -vi'
alias sudo='sudo '
alias pings='ping -c4 google.com'
alias nh='sudo nethogs enp3s0'
alias reboot='systemctl reboot'
alias poweroff='systemctl poweroff'What is going wrong?
Thanks