Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

a way to get the value of the -c option



zsh should provide a way to get the value of the -c option. Under
Linux, one can look at /proc/$$/cmdline, but I think that it would
be better to get this information in an OS-independent way.

This would be useful for .zshenv to know the context, for instance, as
a user of OpenSSH, to know whether this is a shell used for ~/.ssh/rc
(the -c value is '/bin/sh .ssh/rc' in this case). When $DISPLAY is
set, I set up a part of my X11 environment from .zshenv, and this
includes an execution of xdpyinfo, but before the ~/.ssh/rc script is
executed, the xauth authorization hasn't been added yet, so that I get
an annoying error message. So, the idea is to disable this set up for
this -c value.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Messages sorted by: Reverse Date, Date, Thread, Author