Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Slackware

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-25-2008, 09:00 AM
ricky
 
Posts: n/a
Midnight Commander [MC] - help for Option

Hi.
So1 kows how to stay in the selected directory when you exit from MC. ?
I remember there was an option to fix somewhere but I don't remember.

Thank you





Reply With Quote
  #2 (permalink)  
Old 06-25-2008, 12:45 PM
Res
 
Posts: n/a
Re: Midnight Commander [MC] - help for Option

On Wed, 25 Jun 2008, ricky wrote:

>
> Hi.
> So1 kows how to stay in the selected directory when you exit from MC. ?
> I remember there was an option to fix somewhere but I don't remember.



in /usr/share/mc/bin/mc-wrapper.csh

I use ....


set MC_USER="`id | sed 's/[^(]*(//;s/).*//'`"

if ($?TMPDIR) then
setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$
else
setenv MC_PWD_FILE /tmp/mc-$MC_USER/mc.pwd.$$
endif

/usr/bin/mc -P "$MC_PWD_FILE" $*

if (-r "$MC_PWD_FILE") then
setenv MC_PWD "`cat '$MC_PWD_FILE'`"
if ( -d "$MC_PWD" ) then
cd "$MC_PWD"
endif
unsetenv MC_PWD
endif

rm -f "$MC_PWD_FILE"
unsetenv MC_PWD_FILE






--
Cheers
Res
--- Usenet policy, and why I might ignore you ---
1/ GoogleGroups are UDP'd on my nntp server. If you use them, don't
waste your time or energy replying to me.

2/ If only cleanfeed filtered out trolls as well as spam, usenet would be
a nicer place.
Reply With Quote
  #3 (permalink)  
Old 06-25-2008, 12:49 PM
Res
 
Posts: n/a
Re: Midnight Commander [MC] - help for Option

On Wed, 25 Jun 2008, Res wrote:

> On Wed, 25 Jun 2008, ricky wrote:
>
>>
>> Hi.
>> So1 kows how to stay in the selected directory when you exit from MC. ?
>> I remember there was an option to fix somewhere but I don't remember.

>
>
> in /usr/share/mc/bin/mc-wrapper.csh
>
> I use ....
>
>
> set MC_USER="`id | sed 's/[^(]*(//;s/).*//'`"
>
> if ($?TMPDIR) then
> setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$
> else
> setenv MC_PWD_FILE /tmp/mc-$MC_USER/mc.pwd.$$
> endif
>
> /usr/bin/mc -P "$MC_PWD_FILE" $*
>
> if (-r "$MC_PWD_FILE") then
> setenv MC_PWD "`cat '$MC_PWD_FILE'`"
> if ( -d "$MC_PWD" ) then
> cd "$MC_PWD"
> endif
> unsetenv MC_PWD
> endif
>
> rm -f "$MC_PWD_FILE"
> unsetenv MC_PWD_FILE
>




oops I prefer tcsh if you are using bash ...
in /usr/share/mc/bin/mc-wrapper.sh


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


..... most of my boxes have been upgrades through upgrades etc etc, so I
have no idea if thats what in a 'fresh install' on mc these days.

--
Cheers
Res
--- Usenet policy, and why I might ignore you ---
1/ GoogleGroups are UDP'd on my nntp server. If you use them, don't
waste your time or energy replying to me.

2/ If only cleanfeed filtered out trolls as well as spam, usenet would be
a nicer place.
Reply With Quote
  #4 (permalink)  
Old 06-26-2008, 03:41 PM
ricky
 
Posts: n/a
Re: Midnight Commander [MC] - help for Option

Thank for your help.
Unfortunatly my scripts (in mc.sh and mc.csh) are exactly the sameand do not
work.
Any other Idea ?


"Res" <res@ausics.net> a écrit dans le message de news:
Pine.LNX.4.64.0806252245370.7415@ebfjryy.nhfvpf.ar g...
> On Wed, 25 Jun 2008, Res wrote:
>
>> On Wed, 25 Jun 2008, ricky wrote:
>>
>>>
>>> Hi.
>>> So1 kows how to stay in the selected directory when you exit from MC. ?
>>> I remember there was an option to fix somewhere but I don't remember.

>>
>>
>> in /usr/share/mc/bin/mc-wrapper.csh
>>
>> I use ....
>>
>>
>> set MC_USER="`id | sed 's/[^(]*(//;s/).*//'`"
>>
>> if ($?TMPDIR) then
>> setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$
>> else
>> setenv MC_PWD_FILE /tmp/mc-$MC_USER/mc.pwd.$$
>> endif
>>
>> /usr/bin/mc -P "$MC_PWD_FILE" $*
>>
>> if (-r "$MC_PWD_FILE") then
>> setenv MC_PWD "`cat '$MC_PWD_FILE'`"
>> if ( -d "$MC_PWD" ) then
>> cd "$MC_PWD"
>> endif
>> unsetenv MC_PWD
>> endif
>>
>> rm -f "$MC_PWD_FILE"
>> unsetenv MC_PWD_FILE
>>

>
>
>
> oops I prefer tcsh if you are using bash ...
> in /usr/share/mc/bin/mc-wrapper.sh
>
>
> 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
>
>
> .... most of my boxes have been upgrades through upgrades etc etc, so I
> have no idea if thats what in a 'fresh install' on mc these days.
>
> --
> Cheers
> Res
> --- Usenet policy, and why I might ignore you ---
> 1/ GoogleGroups are UDP'd on my nntp server. If you use them, don't
> waste your time or energy replying to me.
>
> 2/ If only cleanfeed filtered out trolls as well as spam, usenet would be
> a nicer place.



Reply With Quote
  #5 (permalink)  
Old 06-26-2008, 04:57 PM
Thomas Overgaard
 
Posts: n/a
Re: Midnight Commander [MC] - help for Option


ricky wrote :

> Any other Idea ?


Use the <TAB> key before you close mc, the directory in active panel
will be forgotten and the directory in not active panel will be
remembered.

Or you could start mc this way 'mc ~/Dir1 ~/Dir2' then these two
directories will show up in the panels.
--
Thomas O.

This area is designed to become quite warm during normal operation.
Reply With Quote
  #6 (permalink)  
Old 06-26-2008, 10:25 PM
Res
 
Posts: n/a
Re: Midnight Commander [MC] - help for Option

On Thu, 26 Jun 2008, ricky wrote:

>
> Thank for your help.
> Unfortunatly my scripts (in mc.sh and mc.csh) are exactly the sameand do not
> work.
> Any other Idea ?
>


How did you install it? Where did you get it from and what is the exact
package name you are using, I'll see if it differs.

Mines... ls /var/log/packages/mc*
/var/log/packages/mc-4.6.1_20070309-i486-2


--
Cheers
Res
--- Usenet policy, and why I might ignore you ---
1/ GoogleGroups are UDP'd on my nntp server. If you use them, don't
waste your time or energy replying to me.

2/ If only cleanfeed filtered out trolls as well as spam, usenet would be
a nicer place.
Reply With Quote
  #7 (permalink)  
Old 06-26-2008, 10:29 PM
Res
 
Posts: n/a
Re: Midnight Commander [MC] - help for Option

On Thu, 26 Jun 2008, Thomas Overgaard wrote:

>
>
> ricky wrote :
>
>> Any other Idea ?

>
> Use the <TAB> key before you close mc, the directory in active panel
> will be forgotten and the directory in not active panel will be
> remembered.
>
> Or you could start mc this way 'mc ~/Dir1 ~/Dir2' then these two
> directories will show up in the panels.
>


A better thing to do is set, say the left panel, as 'info' .. if he's
running the same version as I am, maybe this is where it is faulting, as I
have always used left panel for info so we only ever see one dir/file
listing, in the old days we used to have to modify as it never remembered
the current dir, but I thought we changed that a few years ago.

--
Cheers
Res
--- Usenet policy, and why I might ignore you ---
1/ GoogleGroups are UDP'd on my nntp server. If you use them, don't
waste your time or energy replying to me.

2/ If only cleanfeed filtered out trolls as well as spam, usenet would be
a nicer place.
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Slackware


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:04 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108