Bash startup errors.
Bug #1194155 reported by
terriblenight
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinux |
In Progress
|
Low
|
terriblenight |
Bug Description
After logging in to Cinux 2.2 and dropping to Bash, you get the error that the commands "pathprepend" and "pathappend" do not exist.
Changed in cinux: | |
status: | Confirmed → In Progress |
To post a comment you must log in.
The solution lies in the creation of a simple script:
cat > /etc/profile << "EOF"
# Begin /etc/profile
# Written for Beyond Linux From Scratch
# by James Robertson <email address hidden>
# modifications by Dagmar d'Surreal <email address hidden>
# System wide environment variables and startup programs.
# System wide aliases and functions should go in /etc/bashrc. Personal
# environment variables and startup programs should go into
# ~/.bash_profile. Personal aliases and functions should go into
# ~/.bashrc.
# Functions to help us manage paths. Second argument is the name of the ${2:-PATH}
NEWPATH= ${NEWPATH: +$NEWPATH: }$DIR "$NEWPATH"
# path variable to be modified (default: PATH)
pathremove () {
local IFS=':'
local NEWPATH
local DIR
local PATHVARIABLE=
for DIR in ${!PATHVARIABLE} ; do
if [ "$DIR" != "$1" ] ; then
fi
done
export $PATHVARIABLE=
}
pathprepend () { ${2:-PATH} "$1${!PATHVARIA BLE:+:$ {!PATHVARIABLE} }"
pathremove $1 $2
local PATHVARIABLE=
export $PATHVARIABLE=
}
pathappend () { ${2:-PATH} "${!PATHVARIABL E:+${!PATHVARIA BLE}:}$ 1"
pathremove $1 $2
local PATHVARIABLE=
export $PATHVARIABLE=
}
# Set the initial path
export PATH=/bin:/usr/bin
if [ $EUID -eq 0 ] ; then
pathappend /sbin:/usr/sbin
unset HISTFILE
fi
# Setup some environment variables. "&:[bf] g:exit"
export HISTSIZE=1000
export HISTIGNORE=
# Setup a red prompt for root and a green one for users. \[\e[1; 32m\]"
NORMAL="\[\e[0m\]"
RED="\[\e[1;31m\]"
GREEN="
if [[ $EUID == 0 ]] ; then
PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
else
PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
fi
for script in /etc/profile.d/*.sh ; do
if [ -r $script ] ; then
. $script
fi
done
# Now to clean up
unset pathremove pathprepend pathappend
# End /etc/profile
EOF