Re: How to know when mc is running in a terminal



Mike Smithson <mdooligan 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]