From 760986f989ab90a1d39d3d93840e55f4e6129d0e Mon Sep 17 00:00:00 2001 From: eshanized Date: Thu, 2 Jan 2025 11:14:09 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs:=20add=20inline=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bashrc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.bashrc b/.bashrc index 17eaee5..59f8547 100644 --- a/.bashrc +++ b/.bashrc @@ -6,8 +6,8 @@ # Function to append to PATH if not already present append_path () { case ":$PATH:" in - *:"$1":*) ;; - *) PATH="${PATH:+$PATH:}$1" ;; + *:"$1":*) ;; # If the given path is already in $PATH, do nothing + *) PATH="${PATH:+$PATH:}$1" ;; # Otherwise, append the given path to $PATH esac } @@ -17,14 +17,14 @@ append_path "$HOME/.local/bin" append_path "$HOME/.bin" # Append .bin only if directory exists # Enable bash completion if available -if [ -f /usr/share/bash-completion/bash_completion ]; then - . /usr/share/bash-completion/bash_completion -elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion -fi +if [ -f /usr/share/bash-completion/bash_completion ]; then # Check if bash completion script is available at the first path + . /usr/share/bash-completion/bash_completion # Source the bash completion script to enable autocomplete features +elif [ -f /etc/bash_completion ]; then # If the first path does not exist, check the second path for the script + . /etc/bash_completion # Source the bash completion script from the second location +fi # End the conditional block # Check if the shell is interactive, and only execute below in interactive shells -[[ $- != *i* ]] && return +[[ $- != *i* ]] && return # If the shell is not interactive (does not have 'i' in $-), return and do not execute further commands # Set default aliases