Re: the -P option



On Mon, Mar 06, 2006 at 22:07:45 -0500, email pontios com wrote:

 I would like to enable mc when I quit to stay in the <dir> I was in
 the mc session, on the manual I read ...

My Linux (Slackware) has (effected by /etc/profile.d/mc.sh, or by an
equivalent mc.csh):

alias mc='. /usr/share/mc/bin/mc-wrapper.sh'

where that file (probably already present) is:

MC_USER=`id | sed 's/[^(]*(//;s/).*//'`
MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"
/usr/bin/mc -P "$MC_PWD_FILE" "$@"

if test -r "$MC_PWD_FILE"; then
        MC_PWD="`cat $MC_PWD_FILE`"
        if test -n "$MC_PWD" && test -d "$MC_PWD"; then
                cd "$MC_PWD"
        fi
        unset MC_PWD
fi

rm -f "$MC_PWD_FILE"
unset MC_PWD_FILE

-- 
John F Hall



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]