slitaz-base-files view rootfs/etc/profile @ rev 46

man: take a look at mirror.slitaz.org
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jul 16 11:04:21 2008 +0000 (2008-07-16)
parents fe0055196ad1
children 9fffc4211cd4
line source
1 # /etc/profile: system-wide .profile file for the Bourne shells
3 PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
4 LD_LIBRARY_PATH="/usr/lib:/lib"
6 # Prompt format for Ash (Bash use /etc/bashrc).
7 #
8 if [ "`id -u`" -eq 0 ]; then
9 # Light green and blue colored prompt.
10 #PS1='\e[1;31m\u@\h\e[0m:\e[1;34m\w\e[0m\# '
11 PS1='\u@\h:\w\# '
12 else
13 # Light green and blue colored prompt.
14 PS1='\e[1;32m\u@\h\e[0m:\e[1;34m\w\e[0m\$ '
15 #PS1='\u@\h:\w\$ '
16 fi
18 # Screen display for X and encoding for GTK+ apps.
19 #
20 [ -n "$DISPLAY" ] || DISPLAY=:0.0
21 G_FILENAME_ENCODING=iso8859-1
23 # ldd fake
24 #
25 which ldd > /dev/null || alias ldd='/lib/ld*.so --list'
27 # man fake
28 #
29 if [ ! -x /usr/bin/man ]; then
31 man()
32 {
33 local i
34 local SECTION
35 local MSG
36 local TOPIC
37 local MAN_SECTION
38 case "$1" in
39 ''|-*)
40 cat <<EOT
41 Usage: man [section] command
42 EOT
43 return;;
44 esac
45 SECTION=all
46 MAN_SECTION='*'
47 MSG=""
48 if [ -n "$2" ]; then
49 SECTION=$1
50 MAN_SECTION=$1
51 MSG=" in section $SECTION"
52 shift
53 fi
54 TOPIC=$1
55 if [ -x /usr/bin/retawq -a -f /usr/share/doc/$TOPIC/$TOPIC.html ]; then
56 retawq --dump=file:///usr/share/doc/$TOPIC/$TOPIC.html | less -M
57 return
58 fi
59 for i in /usr/share/$LC_ALL/man$MAN_SECTION /usr/share/man$MAN_SECTION; do
60 if [ -f $i/raw-$TOPIC.* ]; then
61 i=$(ls $i/raw-$TOPIC.*)
62 case "$i" in
63 *gz) (zcat $i || unlzma -c $i 2> /dev/null) | less -M;;
64 *) less -M $i;;
65 esac
66 return
67 fi
68 if [ -x /usr/bin/retawq -a -f $i/$TOPIC.html ]; then
69 retawq --dump=file://$i/$TOPIC.html | less -M
70 return
71 fi
72 done
73 (wget -O - "http://mirror.slitaz.org/man/$SECTION/$TOPIC.html" || \
74 wget -O - "http://man.he.net/?topic=$TOPIC&section=$SECTION") 2> /dev/null | \
75 awk "BEGIN { s=0; n=0 } /<PRE>/ { s=1 } { if (s) { print; n++} } /<\/PRE>/ { s=0 } END { if (n == 0) print \"No manual entry for $TOPIC$MSG\" }" | \
76 sed -e 's/<[^>]*>//g' -e 's/&lt;/</g' -e 's/&gt;/>/g' -e 's/&amp;/\&/g' | less -M
77 }
79 fi
82 # Export all variables definied above and set mask.
83 #
84 export PATH LD_LIBRARY_PATH PS1 DISPLAY G_FILENAME_ENCODING ignoreeof
85 umask 022
87 # Locale and timezone settings.
88 #
89 if [ -s "/etc/locale.conf" ]; then
90 . /etc/locale.conf
91 export LANG LC_ALL
92 fi
93 if [ -s "/etc/TZ" ]; then
94 TZ=`cat /etc/TZ`
95 export TZ
96 fi