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:content-type:content-transfer-encoding :subject:message-id:date:to:mime-version; q=dns; s=default; b=So o8VeYVd7hLK2FlZwk4BdYU8kbFMXsC5JrNC6RFkQ07s5g+s+cNHeXUowA7TOQjs7 jO7m8Foi3PvAWFgj9qXbs16NZR7gDJ+C17z6QEYQQRMofw9nVHVc+oJ9DdpOma5P AojQwfPWaYd6oWyuJtvr/o1lX0GCnd20O2x8sv+CA= 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:content-type:content-transfer-encoding :subject:message-id:date:to:mime-version; s=default; bh=OZH9bfy9 XMCASMcMiXWjz/dO2nc=; b=xpLD7dKut9ZZ1PiEMyxjNbMK5yxBcnn4GlSiQVx0 sgjaZg2geSoPxaJ9ORLTe/xCYgG49u81M16TK+83coJXUkbAQfAIH1IyHgHN/8Ya lltululUv3kYUlbiRVLmfvoo3Wm/1Xdg0KY79NM/rFL91HTh5hj+/OfWa46iU35z rZQ= 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=2.0 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=U*user, administrator, H*r:envelope-sender, you X-HELO: etr-usa.com From: Warren Young Content-Type: text/plain; charset=utf-8 Subject: Change PS1 when run as administrator Message-Id: Date: Tue, 15 Mar 2016 10:20:00 -0600 To: The Cygwin Mailing List Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u2FGKKb3023576 I just came up with this recipe to change the default PS1 value to use red for the user AT host part of the prompt and to change the $ character to a #: if id | grep -qi 'member of administrators group' then export PS1=$(echo "$PS1" | sed -e 's_32_31_' -e 's_\\\$_#_') fi 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. Perhaps something like this should go into the default /etc/profile? -- 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