xref: /haiku/data/etc/profile (revision a1163de83ea633463a79de234b8742ee106531b2)
1#
2# Administrative startup for /bin/sh
3# Place user customizations in /.profile
4#
5
6echo -e "\nWelcome to the Haiku shell.\n"
7
8export PS1="\w> "
9export HISTFILESIZE=50
10
11alias ls="ls --color"
12alias ll="ls -lA"
13alias la="ls -A"
14alias m="more"
15
16shopt -s checkwinsize
17
18#
19# and now we include a few useful things...
20#
21
22#
23# An almost-ksh compatible `whence' command.  This is as hairy as it is
24# because of the desire to exactly mimic ksh.
25#
26# This depends somewhat on knowing the format of the output of the bash
27# `builtin type' command.
28#
29# Chet Ramey
30# chet@ins.CWRU.Edu
31#
32whence()
33{
34	local vflag= path=
35
36	if [ "$#" = "0" ] ; then
37		echo "whence: argument expected"
38		return 1
39	fi
40	case "$1" in
41		-v) vflag=1
42		    shift 1
43		    ;;
44		-*) echo "whence: bad option: $1"
45		    return 1
46		    ;;
47		 *) ;;
48	esac
49
50	if [ "$#" = "0" ] ; then
51		echo "whence: bad argument count"
52		return 1
53	fi
54
55	returnValue=0
56
57	for cmd
58	do
59		if [ "$vflag" ]	 ; then
60			echo $(builtin type $cmd | sed 1q)
61		else
62			path=$(builtin type -path $cmd)
63			if [ "$path" ] ; then
64				echo $path
65			else
66				case "$cmd" in
67					*/*) if [ -x "$cmd" ]; then
68							echo "$cmd"
69						else
70							returnValue=1
71					    fi
72					    ;;
73					 *) case "$(builtin type -type $cmd)" in
74						"") returnValue=1
75							;;
76						 *) echo "$cmd"
77						    ;;
78					    esac
79					    ;;
80				esac
81			fi
82		fi
83	done
84	return $returnValue
85}
86
87alias which='whence'
88
89function dir {
90	ls -lF "$@";
91}
92
93# enable programmable completion
94if [ -f /etc/bash_completion ]; then
95    . /etc/bash_completion
96fi
97
98