#!/usr/bin/env bash# safely installs the custom .bashrc configuration and aliases.TARGET="$HOME/.bashrc"if[-f"$TARGET"];thenecho"Backing up existing .bashrc to ~/.bashrc.bak..."cp"$TARGET""$HOME/.bashrc.bak"ficat<<'EOF' >"$TARGET"# .bashrc# Source global definitionsif [ -f /etc/bashrc ]; then . /etc/bashrcfi# User specific environmentif ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then PATH="$HOME/.local/bin:$HOME/bin:$PATH"fiexport PATH# Uncomment the following line if you don't like systemctl's auto-paging feature:# export SYSTEMD_PAGER=# User specific aliases and functionsif [ -d ~/.bashrc.d ]; then for rc in ~/.bashrc.d/*; do if [ -f "$rc" ]; then . "$rc" fi donefiunset rc# enable color support of ls and also add handy aliasesif [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' #alias dir='dir --color=auto' #alias vdir='vdir --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto'fi# some more ls aliasesalias ll='ls -alF'alias la='ls -A'alias l='ls -CF'alias c='clear'alias u='sudo update'alias g='ssh -T git@github.com'alias s='sudo shutdown now'export PS1="\u@\h:\w\$ "EOFecho".bashrc has been successfully updated and configured."