]> git.pld-linux.org Git - projects/setup.git/blob - etc/profile
- don't barf when 'bind' fails (ksh)
[projects/setup.git] / etc / profile
1 # /etc/profile
2
3 # System wide environment and startup programs
4 # Functions and aliases go into the shells dependent startup files
5
6 PATH="$PATH:/usr/X11R6/bin"
7
8 if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
9         umask 002
10 else
11         umask 022
12 fi
13
14 USER=`id -un`
15 LOGNAME=$USER
16 MAIL="/var/mail/$USER"
17
18 HOSTNAME=`/bin/hostname`
19 HISTFILE="$HOME/.history"
20 HISTSIZE=1000
21 HISTFILESIZE=1000
22
23 #
24 # Setup the environment for varius shells
25 #
26
27 if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
28  TERM=linux
29 fi
30
31 SH="${0#\-}"
32 if [ "$SH" = "sh" ]; then
33         if [ -n "$KSH_VERSION" ]; then
34                 SH=ksh
35         elif [ -n "$BASH_VERSION" ]; then
36                 SH=bash
37         fi
38 fi
39
40 case "$SH" in
41   bash)
42         PS1="[\u@\h \W]\\$ "
43         ;;
44   ksh|pdksh)
45         if [ `id -u` -eq 0 ]; then
46                 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
47                         if [ "$PWD" = "/${PWD##*/}" ]; then
48                                 echo $PWD;
49                         else
50                                 echo ${PWD##*/};
51                 fi`]# '
52         else
53                 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
54                         if [ "$PWD" = "/${PWD##*/}" ]; then
55                                 echo $PWD;
56                         else
57                                 echo ${PWD##*/};
58                 fi`]$ '
59         fi
60         PS2='> '
61         set -o emacs
62         bind '^I'=complete >/dev/null 2>&1
63         bind '^[^I'=complete-list >/dev/null 2>&1
64         #
65         # Setup some of the most basic editing functions
66         # to work properly under different termnal emulators.
67         #
68         case $TERM in
69         nxterm|xterm|xterm-color|rxvt)
70                 bind '^[[H'=beginning-of-line >/dev/null 2>&1
71                 bind '^[[F'=end-of-line >/dev/null 2>&1
72                 ;;
73         linux)
74                 bind '^[1~'=beginning-of-line >/dev/null 2>&1
75                 bind '^[4~'=end-of-line >/dev/null 2>&1
76                 ;;
77         esac
78         ;;
79   zsh)
80         PS1="[%m:%~%]# "
81         ;;
82 esac
83
84 unset SH
85 export PATH PS1 PS2 HOSTNAME HISTFILE HISTSIZE HISTFILESIZE USER LOGNAME MAIL
86
87 for i in /etc/profile.d/*.sh ; do
88         if [ -x $i ]; then
89                 . $i
90         fi
91 done
92
93 unset i
This page took 0.026841 seconds and 3 git commands to generate.