Add user .bashrc and .bash_profile files and slightly modified the system bashrc

This commit is contained in:
2025-04-23 07:38:38 +03:00
parent 53c945b657
commit f562d2d86b
6 changed files with 29 additions and 12 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
name: bash
description: The Bourne-Again Shell
version: 5.2.37
revision: 2
revision: 3
url: https://www.gnu.org/software/bash/
license: GPL3-or-later
architecture: any
keep: ["etc/bashrc","etc/profile"]
keep: ["etc/bashrc","etc/profile","etc/skel/.bash_profile","etc/skel/.bashrc"]
depends: ["glibc","readline","readline"]
optional_depends: ["bash-completion"]
provides: ["sh"]
+5 -4
View File
@@ -1,6 +1,7 @@
# /etc/bashrc
# Setting bash prompt if not in chroot
if ! [ "$(awk '$5=="/" {print $1}' </proc/1/mountinfo)" != "$(awk '$5=="/" {print $1}' </proc/$$/mountinfo)" ]; then
PS1='[\u@\h \W]\$ '
fi
# Return if not running interactively
[[ $- == *i* ]] || return
# Set bash prompt
PS1='[\u@\h \W]\$ '
+5 -5
View File
@@ -22,17 +22,17 @@ if [ -f /etc/locale.conf ]; then
set +a
fi
# Source scripts in profile.d
if [ -d /etc/profile.d ]; then
for f in /etc/profile.d/*.sh; do
[ -r "$f" ] && source "$f"
[ -r "$f" ] && . "$f"
done
fi
# Unsetting functions
unset -f append_path
# Run /etc/bashrc if in an interactive terminal
if [[ $- == *i* ]]; then
. /etc/bashrc
# Run /etc/bashrc if running in a non-posix-compliant bash shell and if the file exists
if [ -f /etc/bashrc ] && [ -n "$BASH" ] && [ -z "$POSIXLY_CORRECT"]; then
. /etc/bashrc
fi
+4
View File
@@ -0,0 +1,4 @@
# ~/.bash_profile
# Source user .bashrc if it exists
[ -f $HOME/.bashrc ] && source $HOME/.bashrc
+7
View File
@@ -0,0 +1,7 @@
# ~/.bashrc
# Return if not running interactively
[[ $- == *i* ]] || return
# Set bash prompt
PS1='[\u@\h \W]\$ '
+5
View File
@@ -41,5 +41,10 @@ package() {
install -Dm644 ../bashrc "$BPM_OUTPUT"/etc/bashrc
install -d "$BPM_OUTPUT"/etc/profile.d
# Default user files
install -Dm644 ../user.bash_profile "$BPM_OUTPUT"/etc/skel/.bash_profile
install -Dm644 ../user.bashrc "$BPM_OUTPUT"/etc/skel/.bashrc
# Install package license
install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/bash/COPYING
}