haiku/data/etc/profile
Michael Lotz d280260742 Add export to our default profile to ignore duplicate history entries.
Fixes enhancement #4156.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 23:49:16 +00:00

99 lines
1.5 KiB
Bash

#
# Administrative startup for /bin/sh
# Place user customizations in /.profile
#
echo -e "\nWelcome to the Haiku shell.\n"
export PS1="\w> "
export HISTFILESIZE=50
export HISTCONTROL=ignoredups
alias ls="ls --color"
alias ll="ls -lA"
alias la="ls -A"
alias m="more"
shopt -s checkwinsize
#
# and now we include a few useful things...
#
#
# An almost-ksh compatible `whence' command. This is as hairy as it is
# because of the desire to exactly mimic ksh.
#
# This depends somewhat on knowing the format of the output of the bash
# `builtin type' command.
#
# Chet Ramey
# chet@ins.CWRU.Edu
#
whence()
{
local vflag= path=
if [ "$#" = "0" ] ; then
echo "whence: argument expected"
return 1
fi
case "$1" in
-v) vflag=1
shift 1
;;
-*) echo "whence: bad option: $1"
return 1
;;
*) ;;
esac
if [ "$#" = "0" ] ; then
echo "whence: bad argument count"
return 1
fi
returnValue=0
for cmd
do
if [ "$vflag" ] ; then
echo $(builtin type $cmd | sed 1q)
else
path=$(builtin type -path $cmd)
if [ "$path" ] ; then
echo $path
else
case "$cmd" in
*/*) if [ -x "$cmd" ]; then
echo "$cmd"
else
returnValue=1
fi
;;
*) case "$(builtin type -type $cmd)" in
"") returnValue=1
;;
*) echo "$cmd"
;;
esac
;;
esac
fi
fi
done
return $returnValue
}
alias which='whence'
function dir {
ls -lF "$@";
}
# enable programmable completion
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi