delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/08/17/16:36:25

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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type:content-transfer-encoding
:reply-to; q=dns; s=default; b=UZv0oZTrxGByv1qDGWZnOj6Y1zeRt0iZD
lABxe8YHJ0Rm6I8Zn0aHW6lbCUuKgFCuC6DjC4LFUS6pm7ZVCtFdl5n0DACsmOwl
2Cm85TlGoMZ/BIOksuaDMZgUVVjz6/1GXfvJhw8M8nangViHJwZVrr9KozXYnxsg
eWIegWpWEk=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type:content-transfer-encoding
:reply-to; s=default; bh=n16YpHhVgOUDNVIepRYOX7dEFgk=; b=k18CCX/
aOAZsRexKOXvgiddJ5biOiGV/LpCWeLQFPM6M1Bf8GUBTGGhit2UTk7lPwOvglNl
vPrDwaHkAWhnUbCaMZd205tVQ4bta35N2DZt/R91na71BKmcHEndMZZ46Q7kValX
yvaENhuM3CcsFoj+P20ZreOFODebtvRXQ9Lk=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=Administrator, rights, Hx-spam-relays-external:ESMTPA
X-HELO: resqmta-ch2-05v.sys.comcast.net
Subject: Re: equivalent to su or sudo?
To: cygwin AT cygwin DOT com
References: <20180817100101 DOT GB24845 AT rus DOT uni-stuttgart DOT de>
From: David Rothenberger <daveroth AT acm DOT org>
Message-ID: <94a4da29-e383-11ec-f2cc-ced6afaf1ae2@acm.org>
Date: Fri, 17 Aug 2018 13:33:57 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0
MIME-Version: 1.0
In-Reply-To: <20180817100101.GB24845@rus.uni-stuttgart.de>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com

Ulli Horlacher wrote:
> I need to run some scripts with full administrator rights (for chown,
> chmod, setfacl).
> Is there a cygwin equivalent to su or sudo?
> 

I use the following shell script to start a command as Administrator. I mainly just use it to start mintty.

#!/bin/bash
cmd="$(cygpath -da "$1")"; shift
if [ $# -gt 0 ]; then
  powershell Start-Process "$cmd" -ArgumentList \""$@"\" -Verb RunAs -WindowStyle Hidden
else
  powershell Start-Process "$cmd" -Verb RunAs -WindowStyle Hidden
fi

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019