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