X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=Thn6YpRNV864Q6FsvtsY7dqaNrRyn9WaWnqllgDggoz dEgSbHJpqN3xI2JYCLdoof/8B4ZkIPsj1WKgLJJOXsaahTGj/h6EorCcqATu0WSB LhOb1SQKbK0AXXB8/+JJsmRjeG982Llha5yef7U7oi4qoSgBvWv48pKq41m69PP8 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; s=default; bh=ngXKPNjUgpe9GVL18uJd/VAhiS0=; b=nVs2w50XHzSE6rS26 Mc+gpZy+UqPFl7MIbMYEteNivBcRmQ/bouLLF+S+LVfVb5p+xLjFYaWvZvymEsrm sP9W2pmH2bdIY5GmWrrSr/qKl0tW17JCsgUVWFMS84riasp1B5h6dLm40akAD3Z+ I1XPKFj41lPAvOc3weQ8ZTa7vk= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Young, interactive, warren, shells X-HELO: mail-in-12.arcor-online.net X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-16.arcor-online.net 3qPjzX28BBz4QK5 From: Achim Gratz To: cygwin AT cygwin DOT com Subject: Re: Change PS1 when run as administrator References: Date: Tue, 15 Mar 2016 19:37:56 +0100 In-Reply-To: (Warren Young's message of "Tue, 15 Mar 2016 10:20:00 -0600") Message-ID: <87d1qv37uj.fsf@Rainer.invalid> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u2FIcKAr004196 Warren Young writes: > I’m not certain the string match on the output of id(1) works > everywhere. Is there a better way to check for admin privileges under > Cygwin? You can’t check for UID or EUID == 0, for example, as you’d > do on a true POSIX system. { id -G | grep -Eq '^544$'; } && echo admin || echo nope > Perhaps something like this should go into the default /etc/profile? No, since it gets read for all shells, not just interactive ones. The only reason the prompt is set at all in /etc/profile on Cygwin is that there is no init/login process to initialize it. But you can always place a script to that effect into /etc/profile.d if you absolutely want it there anyway. I think putting these in the ENV file is preferrable. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf microQ V2.22R2: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple