slitaz-base-files annotate rootfs/etc/profile @ rev 213

/etc/profile: add pushd/popd/dirs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 19 16:42:10 2013 +0100 (2013-02-19)
parents ea47f7a7969e
children b4d39426898f
rev   line source
paul@69 1 # /etc/profile: System-wide .profile file for the Bourne shells
pascal@0 2
fredericguilbault@80 3 PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/sbin:/usr/local/bin"
fredericguilbault@80 4 LD_LIBRARY_PATH="/usr/lib:/lib:/usr/local/lib"
pascal@0 5
pascal@0 6 # Prompt format for Ash (Bash use /etc/bashrc).
pascal@0 7 if [ "`id -u`" -eq 0 ]; then
pascal@0 8 # Light green and blue colored prompt.
pascal@54 9 #PS1='\e[1;31m\u@\h\e[0m:\e[1;34m\w\e[0m\$ '
pascal@54 10 PS1='\u@\h:\w\$ '
pascal@0 11 else
pascal@0 12 # Light green and blue colored prompt.
pankso@67 13 #PS1="\[\e[1;32m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ "
pankso@67 14 PS1='\u@\h:\w\$ '
pascal@0 15 fi
pascal@0 16
paul@93 17 # Max 64M for programs (prevent memory leak crashes)
pascal@49 18 ulimit -d 65536
pascal@50 19 ulimit -m 65536
pascal@58 20
pascal@0 21 # Screen display for X and encoding for GTK+ apps.
pascal@31 22 [ -n "$DISPLAY" ] || DISPLAY=:0.0
pankso@70 23 G_FILENAME_ENCODING=UTF-8
pascal@0 24
pankso@68 25 # Make OpenOffice look better.
pankso@68 26 OOO_FORCE_DESKTOP=gnome
pankso@68 27
MikeDSmith25@48 28 # Export all variables defined above and set mask.
pascal@0 29 #
gokhlayeh@94 30 export PATH LD_LIBRARY_PATH PS1 DISPLAY G_FILENAME_ENCODING
pankso@68 31 export OOO_FORCE_DESKTOP ignoreeof
pascal@0 32 umask 022
pascal@0 33
pascal@0 34 # Locale and timezone settings.
pascal@0 35 #
pascal@34 36 if [ -s "/etc/locale.conf" ]; then
pascal@0 37 . /etc/locale.conf
pascal@0 38 export LANG LC_ALL
pascal@0 39 fi
pascal@34 40 if [ -s "/etc/TZ" ]; then
pascal@0 41 TZ=`cat /etc/TZ`
pascal@0 42 export TZ
pascal@0 43 fi
pascal@206 44 ip=$(ifconfig $(route -n|sed '$!d;s/.* //')|sed '/t a/!d;s/.*:\(.*\) B.*/\1/')
pascal@85 45 case "$TERM" in
pascal@85 46 xterm*|rxvt*) echo -ne "\033]0;$(hostname) $(cat /etc/slitaz-release) $ip\007";;
pascal@85 47 esac
pascal@213 48
pascal@213 49 dirs()
pascal@213 50 {
pascal@213 51 echo $_dirs
pascal@213 52 }
pascal@213 53
pascal@213 54 pushd()
pascal@213 55 {
pascal@213 56 cd $1 && _dirs="$1 $_dirs" && dirs
pascal@213 57 }
pascal@213 58
pascal@213 59 popd()
pascal@213 60 {
pascal@213 61 [ -n "$_dirs" ] && _dirs="${_dirs#* }" && cd ${_dirs%% *} && dirs
pascal@213 62 }