2004-11-03 19:36:40 +03:00
|
|
|
#
|
|
|
|
# Administrative startup for /bin/sh
|
|
|
|
# Place user customizations in /.profile
|
|
|
|
#
|
|
|
|
|
|
|
|
echo -e "\nWelcome to the Haiku shell.\n"
|
|
|
|
|
2010-05-11 18:55:23 +04:00
|
|
|
export USER=`id -un`
|
|
|
|
export GROUP=`id -gn`
|
|
|
|
|
2010-04-29 20:47:05 +04:00
|
|
|
if [ -z $BE_HOST_CPU ]; then
|
2010-04-29 22:15:41 +04:00
|
|
|
. /boot/system/boot/SetupEnvironment
|
2010-04-29 20:47:05 +04:00
|
|
|
fi
|
|
|
|
|
2008-04-26 19:56:01 +04:00
|
|
|
export PS1="\w> "
|
2004-11-03 19:36:40 +03:00
|
|
|
export HISTFILESIZE=50
|
2009-07-30 03:49:16 +04:00
|
|
|
export HISTCONTROL=ignoredups
|
2004-11-03 19:36:40 +03:00
|
|
|
|
2005-02-12 07:05:27 +03:00
|
|
|
alias ls="ls --color"
|
2008-10-17 01:34:15 +04:00
|
|
|
alias ll="ls -lA"
|
2008-02-25 15:52:16 +03:00
|
|
|
alias la="ls -A"
|
2008-02-25 16:19:29 +03:00
|
|
|
alias m="more"
|
2005-02-12 07:05:27 +03:00
|
|
|
|
2008-12-04 00:23:04 +03:00
|
|
|
shopt -s checkwinsize
|
|
|
|
|
2004-11-03 19:36:40 +03:00
|
|
|
#
|
|
|
|
# and now we include a few useful things...
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
2008-10-17 01:34:15 +04:00
|
|
|
# An almost-ksh compatible `whence' command. This is as hairy as it is
|
2004-11-03 19:36:40 +03:00
|
|
|
# because of the desire to exactly mimic ksh.
|
2008-10-17 01:34:15 +04:00
|
|
|
#
|
2004-11-03 19:36:40 +03:00
|
|
|
# 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
|
|
|
|
|
2008-04-26 04:50:21 +04:00
|
|
|
returnValue=0
|
|
|
|
|
2004-11-03 19:36:40 +03:00
|
|
|
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
|
2008-04-26 04:50:21 +04:00
|
|
|
*/*) if [ -x "$cmd" ]; then
|
|
|
|
echo "$cmd"
|
|
|
|
else
|
|
|
|
returnValue=1
|
2004-11-03 19:36:40 +03:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*) case "$(builtin type -type $cmd)" in
|
2008-04-26 04:50:21 +04:00
|
|
|
"") returnValue=1
|
|
|
|
;;
|
2004-11-03 19:36:40 +03:00
|
|
|
*) echo "$cmd"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
2008-04-26 04:50:21 +04:00
|
|
|
return $returnValue
|
2004-11-03 19:36:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
alias which='whence'
|
|
|
|
|
|
|
|
function dir {
|
|
|
|
ls -lF "$@";
|
|
|
|
}
|
2009-04-18 02:05:11 +04:00
|
|
|
|
2011-06-20 01:19:36 +04:00
|
|
|
if [ -d /etc/profile.d ]; then
|
|
|
|
for i in /etc/profile.d/*.sh; do
|
|
|
|
if [ -r $i ]; then
|
|
|
|
. $i
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
unset i
|
2009-04-18 02:05:11 +04:00
|
|
|
fi
|