5 suppbindir
=@prefix@
/lib
/mc
/bin
9 if test "$?" != "0"; then
10 echo "Command \`cp $1 $1.orig' failed. File $1 not changed!"
16 #Commented out by mc_fninstall. Source @prefix@/lib/mc/bin/mc.sh instead.
19 /^mc ()[^}]*$/,/}[; ]*$/{
20 # Function definition over several lines
25 # Function definition on one line
30 echo ". $suppbindir/mc.sh" >> $1
32 echo "I commented out the mc () function definitions in $1 and added"
33 echo "\`. $suppbindir/mc.sh'. Your previous profile has been saved as"
37 if test -n `echo $prefix | grep prefix`; then
40 if test x
$BASH = x
; then
45 if test "x$EUID" = x0
; then
50 if test -f $PROFILE; then
51 A
=`grep "mc ()" $PROFILE`
53 if test -n "$BASHRC"; then
54 if test -f $BASHRC; then
55 B
=`grep "mc ()" $BASHRC`
59 if test -n "$A" -o -n "$B"; then
61 echo "While examining your $PROFILE and $BASHRC,"
63 echo "While examining your $PROFILE,"
65 echo "I've found that you have a probably outdated mc () function definition"
66 echo "there. Do you want to replace this function definition with "
67 echo " . $suppbindir/mc.sh"
74 do_compat_replace
$PROFILE
77 do_compat_replace
$BASHRC
82 unset -f do_compat_replace
84 # This doesn't handle the case that $prefix changed
85 A
=`grep "/mc.sh" $PROFILE`
87 if test -n "$BASHRC"; then
88 if test -f $BASHRC; then
89 B
=`grep "/mc.sh" $BASHRC`
98 A
=`typeset -f | grep "mc ()" 2>/dev/null`
99 if test ! -n "$A"; then
100 echo "mc () installation."
101 if test -n "$BASHRC"; then
102 echo "While examining your $PROFILE and $BASHRC,"
104 echo "While examining your $PROFILE,"
106 echo "I've found that you do not source $suppbindir/mc.sh there."
107 echo "This shell script defines a function which enables a feature of mc(1)"
108 echo "that when you leave mc(1), you return to a directory where you were"
109 echo "in mc just before exiting and not to the directory you've started mc"
111 echo "Would you like to append"
112 echo "test -f $suppbindir/mc.sh && . $suppbindir/mc.sh"
113 if test -n "$BASHRC"; then
114 echo "to your (p) $PROFILE (mc function will be active in your login shells)"
115 echo -n "or to your (b) $BASHRC (in every bash instance) or (n) no? [p|b|n] "
117 echo -n "function to your $PROFILE? [y|n] "
120 if test -n "$BASHRC"; then
127 [Pp
]*) INITFILE
=$PROFILE ;;
131 echo 'test -f $suppbindir/mc.sh && . $suppbindir/mc.sh' >>$INITFILE
132 echo "mc () function appended to your $INITFILE"