From mwm@mired.org  Sun May 27 10:44:37 2001
Return-Path: <mwm@mired.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 CAB9D37B424
	for <FreeBSD-gnats-submit@freebsd.org>; 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
Cc:
Subject: [PATCH] env is cool, and should be better documented.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         27690
>Category:       docs
>Synopsis:       [PATCH] env is cool, and should be better documented.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 27 10:50:01 PDT 2001
>Closed-Date:    Thu Jun 7 17:58:04 PDT 2001
>Last-Modified:  Thu Jun 07 17:58:17 PDT 2001
>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:
State-Changed-From-To: open->analyzed 
State-Changed-By: dd 
State-Changed-When: Tue May 29 20:15:45 PDT 2001 
State-Changed-Why:  
Committed to -current with markup fixes and some rewording, thanks! 


Responsible-Changed-From-To: freebsd-doc->dd 
Responsible-Changed-By: dd 
Responsible-Changed-When: Tue May 29 20:15:45 PDT 2001 
Responsible-Changed-Why:  
My MFC reminder. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27690 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dd 
State-Changed-When: Thu Jun 7 17:58:04 PDT 2001 
State-Changed-Why:  
MFC'd 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27690 
>Unformatted:
