From owner-freebsd-questions@FreeBSD.ORG Thu Sep 3 00:28:55 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 06780106566B for ; Thu, 3 Sep 2009 00:28:55 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id B5BEE8FC08 for ; Thu, 3 Sep 2009 00:28:54 +0000 (UTC) Received: from r55.edvax.de (port-92-195-1-225.dynamic.qsc.de [92.195.1.225]) by mx01.qsc.de (Postfix) with ESMTP id ED4AD3CB96; Thu, 3 Sep 2009 02:28:53 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id n830Sq1V001938; Thu, 3 Sep 2009 02:28:53 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 3 Sep 2009 02:28:52 +0200 From: Polytropon To: Dan Nelson Message-Id: <20090903022852.3223abec.freebsd@edvax.de> In-Reply-To: <20090902200648.GF2855@dan.emsphone.com> References: <20090902072659.7829da56@scorpio.seibercom.net> <20090902152821.6baf568c@scorpio.seibercom.net> <20090902200648.GF2855@dan.emsphone.com> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: 'alias' + sudo X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2009 00:28:55 -0000 On Wed, 2 Sep 2009 15:06:48 -0500, Dan Nelson wrote: > sudo does not run root's shell at all; it directly runs whatever is given it > on the commandline. Another idea would to be to call sudo with the desired shell as argument (in order to inherit the aliases), followed by a command as argument to the shell (in order to execute a particular command), something like % sudo bash -c "my_command_alias" It may be possible that bash requires an additional argument to tell it to read ~/.bashrc when invoked in a non-interactive manner. Keep in mind that I haven't tried this solution because I don't use bash on a regular basis. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...