Files
rx3-base/etc/profile.d/rx3.sh
Arnaud G. GIBERT d1f671c128 - Rx3 Profile:
- Add PATH management.
2026-08-01 18:12:18 +02:00

124 lines
3.7 KiB
Bash

#!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# Rx3 Base Profile
#
# Copyright (C) 2000-2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; If not, see
# <https://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------------------
# Global Variable
#-----------------------------------------------------------------------------------------------------------------------------------
for prefix in "/opt/" "/usr/" "/" "/usr/global/" "/usr/local/"
do
for suffix in bin sbin
do
dir=${prefix}${suffix}
PATH="${dir}:$(echo $PATH | sed -e "s%^${dir}:%%" -e "s%:${dir}:%:%" -e "s%:${dir}$%%")"
done
done
export PATH
export MANPATH=$MANPATH:/usr/local/share/man:/usr/global/share/man:/opt/share/man
export CLASSPATH=$CLASSPATH:/usr/local/lib/java:/usr/global/lib/java:/usr/global/lib/java
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/usr/local/share:/usr/global/share:/opt/share
export HISTSIZE=10000
export HISTFILESIZE=5000
export PAGER=less
export MANPAGER="less -isr"
export EDITOR=emacs
#export GIT_ASKPASS='/usr/bin/ksshaskpass'
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=gasp'
#-----------------------------------------------------------------------------------------------------------------------------------
# CatVal
#-----------------------------------------------------------------------------------------------------------------------------------
cateval()
{
while read line
do
eval $line 2>/dev/null
eval echo $( echo $line | sed -e 's/"/\"/g')
done <$1
}
export -f cateval
#-----------------------------------------------------------------------------------------------------------------------------------
# File Enable
#-----------------------------------------------------------------------------------------------------------------------------------
file_enable()
{
fd_file="$1"
fd_state="$2"
if [[ "$fd_state" == "TRUE" ]]
then
if [[ ! -f "${fd_file}" ]]
then
mv ${fd_file}.disable ${fd_file}
fi
else
if [[ -f "${fd_file}" ]]
then
mv ${fd_file} ${fd_file}.disable
fi
fi
}
export -f file_enable
#-----------------------------------------------------------------------------------------------------------------------------------
# Include
#-----------------------------------------------------------------------------------------------------------------------------------
# None
#-----------------------------------------------------------------------------------------------------------------------------------
# Aliases
#-----------------------------------------------------------------------------------------------------------------------------------
alias ll="ls -la"
alias em="emacs"
alias xw="startx"