From owner-freebsd-questions@FreeBSD.ORG Wed Sep 2 20:06:50 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1F7E1065693 for ; Wed, 2 Sep 2009 20:06:50 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email2.allantgroup.com (email2.emsphone.com [199.67.51.116]) by mx1.freebsd.org (Postfix) with ESMTP id 976558FC19 for ; Wed, 2 Sep 2009 20:06:50 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email2.allantgroup.com (8.14.0/8.14.0) with ESMTP id n82K6nKl043451 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 2 Sep 2009 15:06:49 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.3/8.14.3) with ESMTP id n82K6nGp083368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 2 Sep 2009 15:06:49 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.3/Submit) id n82K6nG3083361 for freebsd-questions@freebsd.org; Wed, 2 Sep 2009 15:06:49 -0500 (CDT) (envelope-from dan) Date: Wed, 2 Sep 2009 15:06:48 -0500 From: Dan Nelson To: freebsd-questions@freebsd.org Message-ID: <20090902200648.GF2855@dan.emsphone.com> References: <20090902072659.7829da56@scorpio.seibercom.net> <20090902152821.6baf568c@scorpio.seibercom.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090902152821.6baf568c@scorpio.seibercom.net> X-OS: FreeBSD 7.2-STABLE User-Agent: Mutt/1.5.19 (2009-01-05) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on email2.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email2.allantgroup.com [199.67.51.78]); Wed, 02 Sep 2009 15:06:50 -0500 (CDT) X-Scanned-By: MIMEDefang 2.45 Subject: Re: 'alias' + sudo X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2009 20:06:50 -0000 In the last episode (Sep 02), Jerry said: > On Wed, 2 Sep 2009 13:06:28 -0600 > Tim Judd wrote: > > Because sudo calls the binary, via SUID on sudo. It doesn't pay > > attention to user profiles or rc files (like .bashrc). > > > > I don't use sudo, so I can't recommend past that. > > In other words, sudo is not compatible with the bash 'alias' feature. Is > that correct? I Googled and found several references to sudo and alias; > however, no consensus on how to circumvent the problem. sudo does not run root's shell at all; it directly runs whatever is given it on the commandline. Workarounds include creating an alias that includes sudo in it (alias rootpicom='sudo pico -m'), or creating a shell script that runs what your alias would have, so you can run "sudo picom": /usr/local/bin/picom #! /bin/sh pico -m "$@" -- Dan Nelson dnelson@allantgroup.com