- Initial release: bash profile config & default library included.
This commit is contained in:
97
etc/profile.d/rx3.sh
Normal file
97
etc/profile.d/rx3.sh
Normal file
@@ -0,0 +1,97 @@
|
||||
|
||||
|
||||
# Global Variable
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
export PAGER=less
|
||||
export MANPAGER="less -isr"
|
||||
export EDITOR=emacs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# CatVal
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
cateval()
|
||||
{
|
||||
while read line
|
||||
do
|
||||
eval $line 2>/dev/null
|
||||
eval echo $( echo $line | sed -e 's/"/\"/g')
|
||||
done <$1
|
||||
}
|
||||
|
||||
export -f cateval
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Print
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
print()
|
||||
{
|
||||
if [[ "$1" == "-i" ]]
|
||||
then
|
||||
shift
|
||||
|
||||
str="%s"'\\n'
|
||||
else
|
||||
str="%s"'\n'
|
||||
fi
|
||||
|
||||
printf "${str}" "$*"
|
||||
}
|
||||
|
||||
export -f print
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 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
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
. /usr/lib/rx3/isl.bash
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Aliases
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
alias ll="ls -la"
|
||||
alias em="emacs"
|
||||
Reference in New Issue
Block a user