/[baselayout]/trunk/etc/profile
Gentoo

Diff of /trunk/etc/profile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 344 Revision 345
29then 29then
30 export INPUTRC="/etc/inputrc" 30 export INPUTRC="/etc/inputrc"
31fi 31fi
32 32
33# Extract the value of EDITOR 33# Extract the value of EDITOR
34get_editor() { 34[ -z "$EDITOR" ] && EDITOR="`. /etc/rc.conf; echo $EDITOR`" 2>/dev/null
35 [ ! -f "$1" ] && return 35[ -z "$EDITOR" ] && EDITOR="`. /etc/conf.d/basic; echo $EDITOR`" 2>/dev/null
36 36[ -z "$EDITOR" ] && EDITOR="/bin/nano"
37 local editor="`gawk ' 37export EDITOR
38 /^[[:space:]]*EDITOR[[:space:]]*=/ {
39 38
40 sub(/^[[:space:]]*EDITOR[[:space:]]*=/, "")
41 EDITOR = $0
42 }
43
44 END { print EDITOR }
45 ' $1`"
46
47 bash -c "eval echo $editor"
48}
49
50if [ -f /etc/rc.conf -a -n "`get_editor /etc/rc.conf`" ]
51then
52 export EDITOR="`get_editor /etc/rc.conf`"
53
54elif [ -f /etc/conf.d/basic -a -n "`get_editor /etc/conf.d/basic`" ]
55then
56 export EDITOR="`get_editor /etc/conf.d/basic`"
57
58else
59 export EDITOR="/bin/nano"
60fi
61
62# We do not need this floating around
63unset get_editor
64

Legend:
Removed from v.344  
changed lines
  Added in v.345

  ViewVC Help
Powered by ViewVC 1.1.20