How to know when mc is running in a terminal
meino.cramer at gmx.de
meino.cramer at gmx.de
Mon Nov 10 05:20:28 UTC 2014
Mike Smithson <mdooligan at gmail.com> [14-11-10 03:04]:
>
> I have a specialized F4 script ($EDITOR) that I need
> to know whether my editor is being called from mc or
> not.
>
> The MC_ env vars don't seem to exist when F4 is hit.
>
> Question: how can a script know whether it is being
> called from F4 in mc or just a terminal?
>
> Thanks in advance.
>
> --
> Peace and Cheer
> _______________________________________________
> mc mailing list
> https://mail.gnome.org/mailman/listinfo/mc
>
Hi Mike,
depending on the shell you are using try to find the PPID
(parents/caller process ID). The grep that PPID in the
output of ps -ef. If the process of that PPID is mc...
Its not /that/ straightforward, but... ;)
Good luck!
Best regards,
Meino
More information about the mc
mailing list