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

fix bash/ash line wrap issue
author Bill Nagel <b1+slitaz@nagel.org>
date Fri Dec 12 01:58:57 2008 -0800 (2008-12-12)
parents 7d8b7107b713
children 5f170bbff925
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 # Max 64M for programs (prevent memory leak crashs)
19 ulimit -d 65536
20 ulimit -m 65536
21 ulimit -v 524288
22 # Screen display for X and encoding for GTK+ apps.
23 #
24 [ -n "$DISPLAY" ] || DISPLAY=:0.0
25 G_FILENAME_ENCODING=iso8859-1
27 # ldd fake
28 #
29 which ldd > /dev/null || alias ldd='/lib/ld*.so --list'
31 # man fake
32 #
33 if [ ! -x /usr/bin/man ]; then
35 man()
36 {
37 local i
38 local SECTION
39 local MSG
40 local TOPIC
41 local MAN_SECTION
42 case "$1" in
43 ''|-*)
44 cat <<EOT
45 Usage: man [section] command
46 EOT
47 return;;
48 esac
49 SECTION=all
50 MAN_SECTION='*'
51 MSG=""
52 if [ -n "$2" ]; then
53 SECTION=$1
54 MAN_SECTION=$1
55 MSG=" in section $SECTION"
56 shift
57 fi
58 TOPIC=$1
59 if [ -x /usr/bin/retawq -a -f /usr/share/doc/$TOPIC/$TOPIC.html ]; then
60 retawq --dump=file:///usr/share/doc/$TOPIC/$TOPIC.html | less -M
61 return
62 fi
63 for i in /usr/share/$LC_ALL/man$MAN_SECTION /usr/share/man$MAN_SECTION; do
64 if [ -f $i/raw-$TOPIC.* ]; then
65 i=$(ls $i/raw-$TOPIC.*)
66 case "$i" in
67 *gz) (zcat $i || unlzma -c $i 2> /dev/null) | less -M;;
68 *) less -M $i;;
69 esac
70 return
71 fi
72 if [ -x /usr/bin/retawq -a -f $i/$TOPIC.html ]; then
73 retawq --dump=file://$i/$TOPIC.html | less -M
74 return
75 fi
76 done
77 (wget -O - "http://mirror.slitaz.org/man/$SECTION/$TOPIC.html" || \
78 wget -O - "http://man.he.net/?topic=$TOPIC&section=$SECTION") 2> /dev/null | \
79 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\" }" | \
80 sed -e 's/<[^>]*>//g' -e 's/&lt;/</g' -e 's/&gt;/>/g' -e 's/&amp;/\&/g' | less -M
81 }
83 fi
86 # Export all variables defined above and set mask.
87 #
88 export PATH LD_LIBRARY_PATH PS1 DISPLAY G_FILENAME_ENCODING ignoreeof
89 umask 022
91 # Locale and timezone settings.
92 #
93 if [ -s "/etc/locale.conf" ]; then
94 . /etc/locale.conf
95 export LANG LC_ALL
96 fi
97 if [ -s "/etc/TZ" ]; then
98 TZ=`cat /etc/TZ`
99 export TZ
100 fi