From owner-freebsd-questions Wed Jun 12 15:17:22 2002 Delivered-To: freebsd-questions@freebsd.org Received: from fedde.littleton.co.us (cfedde.dsl.frii.net [216.17.139.141]) by hub.freebsd.org (Postfix) with ESMTP id BED9737B400 for ; Wed, 12 Jun 2002 15:17:17 -0700 (PDT) Received: from fedde.littleton.co.us (localhost [127.0.0.1]) by fedde.littleton.co.us (8.12.3/8.12.3) with ESMTP id g5CMHGt9049543; Wed, 12 Jun 2002 16:17:16 -0600 (MDT) Message-Id: <200206122217.g5CMHGt9049543@fedde.littleton.co.us> To: Andrew Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Sudo In-Reply-To: <1378131622.20020612235319@ukrpost.net> From: Chris Fedde Date: Wed, 12 Jun 2002 16:17:16 -0600 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 12 Jun 2002 23:53:19 +0300 Andrew wrote: +------------------ | Hello list. | | Is there a way to force sudo read .profile? For example, I have an | alias vi='vim' in both root's and user's .profiles. When I run vi as | root being user it starts vi instead of vim. | +------------------ It sounds like you are using 'sudo su' or 'sudo bash' or some similar incantation. That is not the easiest way of using sudo. I like to sodo each command: sudo vi /some/file sudo /usr/local/etc/rc.d/myprog start sudo /usr/sbin/sendmail -bv some@addresss Doing it this way you take avantage of your shells command history, aliases and paths. If you realy want to sudo to a shell you can choose to source the .profile for that shell by telling the shell to load it using an option. sudo bash --login -- Chris Fedde To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message