From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6065 invoked from network); 15 Aug 2000 08:32:01 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Aug 2000 08:32:01 -0000 Received: (qmail 11982 invoked by alias); 15 Aug 2000 08:31:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12636 Received: (qmail 11975 invoked from network); 15 Aug 2000 08:31:40 -0000 Date: Tue, 15 Aug 2000 10:31:29 +0200 (MET DST) Message-Id: <200008150831.KAA05068@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Tue, 15 Aug 2000 11:31:06 +0400 Subject: Re: Passing state information from one completion function to another? Andrej Borsenkow wrote: > What I'd like to have is to list only my own processes in "normal" case and > everything in case of root. This works with a single exception of sudo (and > may be su) - in this case completion happens in current user context and does > not know if it was root or not. > > Is it possible for _sudo to set some state info (notably, that we are after > sudo at all and user name) that can be queried by other functions? Of course, > that shoould be cleaned up after completion exits. This may be useful in other > cases as well - some generic test "if command is to be executed as root/other > user" Shouldn't it be enough to use `zstyle -e' and test if $words contains `sudo' (probably as the first word)? Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de