From owner-freebsd-doc Sun May 27 10:50:11 2001 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 14A4137B42C for ; Sun, 27 May 2001 10:50:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f4RHo2n48061; Sun, 27 May 2001 10:50:02 -0700 (PDT) (envelope-from gnats) Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id CAB9D37B424 for ; Sun, 27 May 2001 10:44:36 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 6154 invoked by uid 100); 27 May 2001 17:44:35 -0000 Message-Id: <20010527174435.6153.qmail@guru.mired.org> Date: 27 May 2001 17:44:35 -0000 From: mwm@mired.org Reply-To: mwm@mired.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: docs/27690: [PATCH] env is cool, and should be better documented. Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 27690 >Category: docs >Synopsis: [PATCH] env is cool, and should be better documented. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun May 27 10:50:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Mike Meyer >Release: FreeBSD 4.3-STABLE i386 >Organization: Meyer consulting >Environment: System: FreeBSD guru.mired.org 4.3-STABLE FreeBSD 4.3-STABLE #17: Sun May 27 08:47:01 CDT 2001 mwm@guru.mired.org:/sharetmp/obj/usr/src/sys/GURU i386 >Description: env actually has some cool applications, but the man page doesn't mention a single possible use. So add one. >How-To-Repeat: Play with env a bit, and figure out how useful it is. Read the man page and notice that none of this is documented. >Fix: Apply the attached patch to the printenv man page. --- usr.bin/printenv/printenv.1 Tue Dec 19 10:22:24 2000 +++ /tmp/printenv.1 Sun May 27 10:22:49 2001 @@ -101,6 +101,20 @@ .Nm env prints out the names and values of the variables in the environment, with one name/value pair per line. +.Pp +.Nm env +is most useful with the +.Li #! +construct. The only difference between +.Li "#! /usr/local/bin/foo" +and +.Li "#! /usr/bin/env /usr/local/bin/foo" +is that the latter works even if +.Pa /usr/local/bin/foo +is itself scripted. The facilities of env allow reference to +.Ic foo +without the path, +and allow the script author to set up environment variables as needed. .Sh SEE ALSO .Xr csh 1 , .Xr sh 1 , >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message