Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
a way to get the value of the -c option
- X-seq: zsh-workers 37282
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: a way to get the value of the -c option
- Date: Thu, 3 Dec 2015 12:54:49 +0100
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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