Hi, I'm having trouble with my bash hash table again. I have mc in /usr/local/bin/mc and everytime I try to run mc, I get -bash "No /usr/bin/mc". I've tried hash -d and I get "hash table is empty", but the mc error continues. So where is this hash table? I reboot and the problem persists, so it has to be written somewhere? It reminds me of windows, haha. -- use Perl; #powerful programmable prestidigitation
zentara <zentara@zentara.net> writes:
I'm having trouble with my bash hash table again. I have mc in /usr/local/bin/mc and everytime I try to run mc, I get -bash "No /usr/bin/mc".
On my system, mc is a bash function: $ typeset -f ... mc () { mkdir -p $HOME/.mc/tmp 2>/dev/null; chmod 700 $HOME/.mc/tmp; MC=$HOME/.mc/tmp/mc-$$; /usr/bin/mc -P "$@" >"$MC"; cd "`cat $MC`"; rm -f "$MC"; unset MC } Use "unset mc" to delete the function. -- Alexandr.Malusek@imv.liu.se
On 27 Dec 2002 13:49:34 +0100 Alexandr Malusek <Alexandr.Malusek@imv.liu.se> wrote:
On my system, mc is a bash function:
Use "unset mc" to delete the function.
Thank you, it blew my mind for awhile. -- use Perl; #powerful programmable prestidigitation
* zentara <zentara@zentara.net> [12-27-02 08:13]:
On 27 Dec 2002 13:49:34 +0100 Alexandr Malusek <Alexandr.Malusek@imv.liu.se> wrote:
On my system, mc is a bash function:
Use "unset mc" to delete the function.
Thank you, it blew my mind for awhile.
or change "/usr/bin/mc -P "$@" > "$MC"; to "/usr/local/bin/mc -P "$@" > "$MC"; -- Patrick Shanahan Registered Linux User #207535 http://home.indy.rr.com/paka @ http://counter.li.org icq#173753138
On Friday 27 December 2002 12:49, Alexandr Malusek wrote:
zentara <zentara@zentara.net> writes:
I'm having trouble with my bash hash table again. I have mc in /usr/local/bin/mc and everytime I try to run mc, I get -bash "No /usr/bin/mc".
On my system, mc is a bash function:
$ typeset -f ... mc () { mkdir -p $HOME/.mc/tmp 2>/dev/null; chmod 700 $HOME/.mc/tmp; MC=$HOME/.mc/tmp/mc-$$; /usr/bin/mc -P "$@" >"$MC"; cd "`cat $MC`"; rm -f "$MC"; unset MC }
As far as I can see, this means that when you quit from mc it changes the pwd of the calling shell to whatever mc was last looking at. Now why would anyone want to do that? Pam R -- Have a good turn-of-the-year-celebration-of-your-choice. Linux StepbyStep: http://www.linux-sxs.org/stepbystep.html
Pam R <pamroberts@blueyonder.co.uk> writes:
/usr/bin/mc -P "$@" >"$MC"; cd "`cat $MC`";
As far as I can see, this means that when you quit from mc it changes the pwd of the calling shell to whatever mc was last looking at. Now why would anyone want to do that?
Ask Torben Fjerdingstad and Sergey. <man mc> -P At program end, the Midnight Commander will print the last working directory. This function should not be used directly, instead, it should be used from a special shell function that will automatically change the current directory of the shell to the last directory the Midnight Commander was in (thanks to Torben Fjerdingstad and Sergey for contributing this function and the code implementing this option). Source the files /opt/gnome/lib/mc/bin/mc.sh (bash and zsh users) respectively /opt/gnome/lib/mc/bin/mc.csh (tcsh users) in order to have this function defined. </man mc> The definition is in /usr/lib/mc/bin/mc.sh in SuSE 8.1. -- Alexandr.Malusek@imv.liu.se
The 02.12.28 at 13:34, Pam R wrote:
$ typeset -f ... mc () { mkdir -p $HOME/.mc/tmp 2>/dev/null; chmod 700 $HOME/.mc/tmp; MC=$HOME/.mc/tmp/mc-$$; /usr/bin/mc -P "$@" >"$MC"; cd "`cat $MC`"; rm -f "$MC"; unset MC }
As far as I can see, this means that when you quit from mc it changes the pwd of the calling shell to whatever mc was last looking at. Now why would anyone want to do that?
Now, this is very interesting: I wanted to disable that behaviour, but I never guessed it involved a bash function. Which file should I edit to change it permanently? It is a nuisance. There is no man page for "typeset", by the way, and "--help" fails. -- Cheers, Carlos Robinson
On Sat, Jan 18, 2003 at 02:13:16PM +0100, Carlos E. R. wrote: : : Now, this is very interesting: I wanted to disable that behaviour, but I : never guessed it involved a bash function. Which file should I edit to : change it permanently? It is a nuisance. : : There is no man page for "typeset", by the way, and "--help" fails. typeset is a bash builtin. It's clearly documented in the bash man page and texinfo document. --Jerry Open-Source software isn't a matter of life or death... ...It's much more important than that!
On Sat, 18 Jan 2003 14:13:16 +0100 (CET) "Carlos E. R." <robin1.listas@tiscali.es> wrote:
$ typeset -f ... mc () { mkdir -p $HOME/.mc/tmp 2>/dev/null; chmod 700 $HOME/.mc/tmp; MC=$HOME/.mc/tmp/mc-$$; /usr/bin/mc -P "$@" >"$MC"; cd "`cat $MC`"; rm -f "$MC"; unset MC }
As far as I can see, this means that when you quit from mc it changes the pwd of the calling shell to whatever mc was last looking at. Now why would anyone want to do that?
Now, this is very interesting: I wanted to disable that behaviour, but I never guessed it involved a bash function. Which file should I edit to change it permanently? It is a nuisance.
There is no man page for "typeset", by the way, and "--help" fails.
Go into /etc/profile.d and rename mc.sh to mc.sh.bak -- use Perl; #powerful programmable prestidigitation
* zentara <zentara@zentara.net> [12-26-02 17:49]:
Hi, I'm having trouble with my bash hash table again. I have mc in /usr/local/bin/mc and everytime I try to run mc, I get -bash "No /usr/bin/mc".
so: ln -s /usr/local/bin/mc /usr/bin/mc -- Patrick Shanahan Registered Linux User #207535 http://home.indy.rr.com/paka @ http://counter.li.org icq#173753138
participants (7)
-
Alexandr Malusek
-
Carlos E. R.
-
Graham Murray
-
Jerry A!
-
Pam R
-
SuSEnixER
-
zentara