]> git.pld-linux.org Git - projects/setup.git/blame - etc/profile
- added saned (6566/tcp)
[projects/setup.git] / etc / profile
CommitLineData
9bfefe38 1# /etc/profile
06efe2f9 2# $Id$
9bfefe38 3
4# System wide environment and startup programs
99306191 5# Functions and aliases go into the shells dependent startup files
9bfefe38 6
505106d0
JR
7[ "`echo $PATH | grep -q /usr/X11R6/bin`" = "" ] && PATH="$PATH:/usr/X11R6/bin"
8[ "`echo $PATH | grep -q "$HOME/bin"`" = "" ] && PATH="$PATH:$HOME/bin"
9bfefe38 9
9bfefe38 10if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
b62ea61b 11 umask 002
9bfefe38 12else
b62ea61b 13 umask 022
9bfefe38 14fi
15
16USER=`id -un`
17LOGNAME=$USER
b62ea61b 18MAIL="/var/mail/$USER"
9bfefe38 19
20HOSTNAME=`/bin/hostname`
9783a53d 21HISTFILE="$HOME/.history"
9bfefe38 22HISTSIZE=1000
23HISTFILESIZE=1000
99306191 24
25#
26# Setup the environment for varius shells
27#
28
b62ea61b
JR
29if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
30 TERM=linux
31fi
32
9783a53d 33SH="${0#\-}"
65b2ff24 34SH="${SH#/bin/}"
558c4ec4 35if [ "$SH" = "sh" ]; then
516614fd 36 if [ -n "$KSH_VERSION" ]; then
9783a53d 37 SH=ksh
de30a7eb
AM
38 elif [ -n "$ZSH_VERSION" ]; then
39 SH=zsh
516614fd 40 elif [ -n "$BASH_VERSION" ]; then
9783a53d
JR
41 SH=bash
42 fi
43fi
44
45case "$SH" in
99306191 46 bash)
516614fd 47 PS1="[\u@\h \W]\\$ "
99306191 48 ;;
49 ksh|pdksh)
8a243315
JR
50 if [ `id -u` -eq 0 ]; then
51 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
52 if [ "$PWD" = "/${PWD##*/}" ]; then
53 echo $PWD;
54 else
55 echo ${PWD##*/};
56 fi`]# '
57 else
58 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
59 if [ "$PWD" = "/${PWD##*/}" ]; then
60 echo $PWD;
61 else
62 echo ${PWD##*/};
63 fi`]$ '
64 fi
99306191 65 PS2='> '
66 set -o emacs
47f173c9
JR
67 bind '^I'=complete >/dev/null 2>&1
68 bind '^[^I'=complete-list >/dev/null 2>&1
99306191 69 #
70 # Setup some of the most basic editing functions
71 # to work properly under different termnal emulators.
72 #
73 case $TERM in
74 nxterm|xterm|xterm-color|rxvt)
47f173c9
JR
75 bind '^[[H'=beginning-of-line >/dev/null 2>&1
76 bind '^[[F'=end-of-line >/dev/null 2>&1
99306191 77 ;;
78 linux)
47f173c9
JR
79 bind '^[1~'=beginning-of-line >/dev/null 2>&1
80 bind '^[4~'=end-of-line >/dev/null 2>&1
99306191 81 ;;
82 esac
83 ;;
84 zsh)
de30a7eb 85 PS1='[%n@%m %~]%(!.#.%\$) '
06efe2f9
AM
86
87 # Setup key bindings
de30a7eb 88 bindkey -e >/dev/null 2>&1
06efe2f9
AM
89 bindkey "^[[1~" beginning-of-line >/dev/null 2>&1
90 bindkey "^[[H" beginning-of-line >/dev/null 2>&1
91 bindkey "^[[4~" end-of-line >/dev/null 2>&1
92 bindkey "^[[F" end-of-line >/dev/null 2>&1
93 bindkey "^[[3~" delete-char >/dev/null 2>&1
94 bindkey "^[[5~" history-search-backward >/dev/null 2>&1
95 bindkey "^[[6~" history-search-forward >/dev/null 2>&1
96
97 case "$TERM" in
98 aterm)
99 bindkey '^[[A' up-line-or-history >/dev/null 2>&1
100 bindkey '^[[B' down-line-or-history >/dev/null 2>&1
101 bindkey '^[[D' backward-char >/dev/null 2>&1
102 bindkey '^[[C' forward-char >/dev/null 2>&1
103 ;;
104 esac
105 # other HISTFILE, zsh uses diffrent fmt
106 HISTFILE=~/.historyz
107 # w/o this hist file wont get saved !
108 SAVEHIST=$HISTSIZE
99306191 109 ;;
110esac
111
9783a53d
JR
112unset SH
113export PATH PS1 PS2 HOSTNAME HISTFILE HISTSIZE HISTFILESIZE USER LOGNAME MAIL
9bfefe38 114
115for i in /etc/profile.d/*.sh ; do
116 if [ -x $i ]; then
117 . $i
118 fi
119done
120
121unset i
06efe2f9
AM
122
123# vi:syntax=sh
This page took 0.071572 seconds and 4 git commands to generate.