From owner-freebsd-hackers Sun Jun 3 23:17: 2 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id 9E4DC37B401 for ; Sun, 3 Jun 2001 23:16:59 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 4050 invoked by uid 100); 4 Jun 2001 06:16:58 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15131.10202.189874.233196@guru.mired.org> Date: Mon, 4 Jun 2001 01:16:58 -0500 To: "Andrew Reilly" Cc: Mark Valentine , Peter Seebach , hackers@freebsd.org Subject: Re: Fixing documented bug in env(1) In-Reply-To: <20010604135106.A8896@gurney.reilly.home> References: <200106032352.f53Nqvn47341@dotar-sojat.thuvia.org> <20010604135106.A8896@gurney.reilly.home> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Andrew Reilly types: > On Mon, Jun 04, 2001 at 12:52:57AM +0100, Mark Valentine wrote: > > By the way, who uses env(1) anyway? In the past twenty years, I've only > > ever used it as shorthand for printenv(1). What's this csh(1) thing? :-) > How else do you throw away your environment, to make sure that > daemons that you start with sudo don't do anything silly? I think it's more commonly used in scripts, so you don't have to worry about where the interpreter is installed. The python folks are recommending the user of "#!/usr/bin/env python" instead of "#!/usr/local/bin/python" for scripts, since the former works no matter where python is installed. I understand that some of the perl installation scripts use the same trick. Even cooler - at least as far as I'm concerned - is that you can do this if your interpreter is a script. That is, where "#!/usr/local/bin/foobar" won't work because foobar is a Perl script, "#!/usr/bin/env foobar" will work just fine. This is documented on the env man page, though I don't think it's been MFC'ed yet. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message