4 if test -n `echo $prefix | grep prefix`; then
7 if test x$BASH = x; then
12 if test "x$EUID" = x0; then
17 if test -f $PROFILE; then
18 A=`grep "mc ()" $PROFILE`
20 if test -n "$BASHRC"; then
21 if test -f $BASHRC; then
22 B=`grep "mc ()" $BASHRC`
31 A=`typeset -f | grep "mc ()" 2>/dev/null`
32 if test ! -n "$A"; then
33 echo "mc () installation."
34 if test -n "$BASHRC"; then
35 echo "While examining your $PROFILE and $BASHRC,"
37 echo "While examining your $PROFILE,"
39 echo "I've found that you have no mc () function defined there."
40 echo "This function enables a feature of mc(1) that when you leave mc(1),"
41 echo "you return to a directory where you were in mc just before exiting"
42 echo "and not to the directory you've started mc from."
43 echo "Would you like to append"
44 echo 'mc () { MC=`'$prefix'/bin/mc -P "$@"`; [ -n "$MC" ] && cd "$MC"; unset MC };'
45 if test -n "$BASHRC"; then
46 echo "function to your (p) $PROFILE (mc function will be active in your login shells)"
47 echo -n "or to your (b) $BASHRC (in every bash instance) or (n) no? [p|b|n] "
49 echo -n "function to your $PROFILE? [y|n] "
52 if test -n "$BASHRC"; then
59 [Pp]*) INITFILE=$PROFILE ;;
62 echo 'mc () { MC=`'$prefix'/bin/mc -P "$@"`; [ -n "$MC" ] && cd "$MC"; unset MC };' >>$INITFILE
63 echo "mc () function appended to your $INITFILE"