midnight commander internal cd in scripts
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? Example: 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. ~/Downloads) as if I'm using the cd in the mini-command line or via quick cd. ___ mc mailing list https://mail.gnome.org/mailman/listinfo/mc
Re: midnight commander internal cd in scripts
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? Example: 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. ~/Downloads) 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. -- Andrew ___ mc mailing list https://mail.gnome.org/mailman/listinfo/mc
Re: midnight commander internal cd in scripts
On Sun, 24 Feb 2013 22:52:19 +0200 Elad Rom wrote: could you give an example for such a script? Example of what? can I run it from mc panels, or from the user menu? Yes from mc command line only via source. Directly from panels (pressing Enter) -- no, because script is executed in the new child process. From user menu -- no, because of the same reason. You can use Directory hotlist to store various directories and fast cd to any of them. -- Andrew ___ mc mailing list https://mail.gnome.org/mailman/listinfo/mc