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