Re: midnight commander internal cd in scripts
- From: Andrew Borodin <aborodin vmail ru>
- To: mc gnome org
- Cc: Elad Rom <webdev eladrom org>
- Subject: Re: midnight commander internal cd in scripts
- Date: Sun, 24 Feb 2013 20:45:52 +0400
On Fri, 22 Feb 2013 20:16:17 +0200 Elad Rom wrote:
Is there a way to cd into a folder (be it ssh, ftp or local folders)
from an existing instance of midnight commander through a shell script?
Inside an open MC instance, in my home folder, there is a file called "somessh.sh".
When I hit enter on this executable, I want mc to cd into the directory I specify inside the file (E.g.
as if I'm using the cd in the mini-command line or via quick cd.
When you run shell script, you run new shell which is child process of MC.
When you do cd in the script, you change working directory of that child
shell. Working directory of parent is unchanged. You unable to change working
directory of parent from child.
You have to use the "source" built-in shell command to run script in current
process context. This allows you change current directory from script.
] [Thread Prev