xref: /haiku/data/etc/profile (revision 39241fe22890fb958b6ba32d6ab9526da98be187)
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
11bind '"\e[2~":paste-from-clipboard'
12bind '"\e[3~":delete-char'
13bind '"\e[4~":end-of-line'
14bind '"\e[5~":history-search-forward'
15bind '"\e[6~":history-search-backward'
16
17#
18# and now we include a few useful things...
19#
20
21#
22# An almost-ksh compatible `whence' command.  This is as hairy as it is
23# because of the desire to exactly mimic ksh.
24#
25# This depends somewhat on knowing the format of the output of the bash
26# `builtin type' command.
27#
28# Chet Ramey
29# chet@ins.CWRU.Edu
30#
31whence()
32{
33	local vflag= path=
34
35	if [ "$#" = "0" ] ; then
36		echo "whence: argument expected"
37		return 1
38	fi
39	case "$1" in
40		-v) vflag=1
41		    shift 1
42		    ;;
43		-*) echo "whence: bad option: $1"
44		    return 1
45		    ;;
46		 *) ;;
47	esac
48
49	if [ "$#" = "0" ] ; then
50		echo "whence: bad argument count"
51		return 1
52	fi
53
54	for cmd
55	do
56		if [ "$vflag" ]	 ; then
57			echo $(builtin type $cmd | sed 1q)
58		else
59			path=$(builtin type -path $cmd)
60			if [ "$path" ] ; then
61				echo $path
62			else
63				case "$cmd" in
64					/*) if [ -x "$cmd" ]; then
65						echo "$cmd"
66					    fi
67					    ;;
68					 *) case "$(builtin type -type $cmd)" in
69						"") ;;
70						 *) echo "$cmd"
71						    ;;
72					    esac
73					    ;;
74				esac
75			fi
76		fi
77	done
78	return 0
79}
80
81alias which='whence'
82
83function dir {
84	ls -lF "$@";
85}
86