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