From owner-freebsd-current@FreeBSD.ORG Fri Nov 23 19:25:24 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED517B86 for ; Fri, 23 Nov 2012 19:25:24 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id BFAA08FC15 for ; Fri, 23 Nov 2012 19:25:24 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id qANJOSAq021985; Fri, 23 Nov 2012 19:24:28 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id 4796ikux3q2dkp6sxbt6jjscqa; Fri, 23 Nov 2012 19:24:28 +0000 (UTC) (envelope-from tim@kientzle.com) Subject: Re: prompt w/ uid 0 for cshrc Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: Date: Fri, 23 Nov 2012 11:24:26 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20121118234426.GA16628@dft-labs.eu> To: jb X-Mailer: Apple Mail (2.1283) Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 19:25:25 -0000 On Nov 19, 2012, at 8:46 AM, jb wrote: > Eitan Adler eitanadler.com> writes: >=20 >>=20 >> On 18 November 2012 18:44, Mateusz Guzik gmail.com> = wrote: >>> Just take user name from id -nu. >>=20 >> While that does provide the $user value I want, id is in /usr/bin/ >> which may not be mounted. >=20 > /rescue/id Bad idea: * /rescue tools are not part of the "standard" world * /rescue tools are sometimes not installed * Quite a few people have customized the rescue tools to adding or = omitting things suitable for their particular installation. * /rescue tools are not guaranteed to be functionally identical to the = non-rescue versions. Better to invoke 'id' in a way that produces "reasonable" results if 'id' is unavailable. For example: /bin/sh -c 'id -nu 2>/dev/null' || echo '?' prints '?' if the id command fails or is unavailable. Tim