From ohashi@ateken2.mickey.ai.kyutech.ac.jp  Wed Nov 18 22:13:37 1998
Received: from ateken2.mickey.ai.kyutech.ac.jp (ateken2.mickey.ai.kyutech.ac.jp [131.206.21.141])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA15859
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 18 Nov 1998 22:13:33 -0800 (PST)
          (envelope-from ohashi@ateken2.mickey.ai.kyutech.ac.jp)
Received: (from ohashi@localhost)
	by ateken2.mickey.ai.kyutech.ac.jp (8.9.1/8.9.1) id PAA17241;
	Thu, 19 Nov 1998 15:14:12 +0900 (JST)
	(envelope-from ohashi)
Message-Id: <199811190614.PAA17241@ateken2.mickey.ai.kyutech.ac.jp>
Date: Thu, 19 Nov 1998 15:14:12 +0900 (JST)
From: ohashi@mickey.ai.kyutech.ac.jp
Reply-To: ohashi@mickey.ai.kyutech.ac.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: psif in printing.sgml in Handbook
X-Send-Pr-Version: 3.2

>Number:         8757
>Category:       docs
>Synopsis:       psif expands unexpected wildcard characters in some files.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 18 22:20:01 PST 1998
>Closed-Date:    Tue Dec 8 14:08:59 PST 1998
>Last-Modified:  Tue Dec  8 14:09:40 PST 1998
>Originator:     Takeshi Ohashi
>Release:        FreeBSD 3.0-RELEASE i386
>Organization:
Dept. of AI, Kyushu Inst. of Tech., Iizuka, JAPAN.
>Environment:

FreeBSD ateken2.mickey.ai.kyutech.ac.jp 3.0-RELEASE FreeBSD 3.0-RELEASE #1: Sun Oct 25 16:04:46 JST 1998     root@ateken2.mickey.ai.kyutech.ac.jp:/usr/src/sys/compile/ATEKEN2  i386

>Description:

psif expands unexpected wildcard characters in some files.

For example, if C source codes start with "/*" characters,
it will be expanded files in the root directory.

To avoide this unexpected expansion, replace printf with echo.

>How-To-Repeat:

Install psif as an input filter for a PS printer
 % cat "/* comment */" | lpr
or
 % cat "/* comment */" | /usr/local/libexec/psif |gs -

>Fix:

--- printing.sgml.orig	Thu Nov 19 14:58:11 1998
+++ printing.sgml	Thu Nov 19 14:59:11 1998
@@ -2245,13 +2245,13 @@
    #
    #  PostScript job, print it.
    #
-   echo $first_line &amp;&amp; cat &amp;&amp; printf "\004" &amp;&amp; exit 0
+   printf "%s\n" "$first_line" &amp;&amp; cat &amp;&amp; printf "\004" &amp;&amp; exit 0
    exit 2
 else
    #
    #  Plain text, convert it, then print it.
    #
-   ( echo $first_line; cat ) | /usr/local/bin/textps &amp;&amp; printf "\004" &amp;&amp; exit 0
+   ( printf "%s\n" "$first_line"; cat ) | /usr/local/bin/textps &amp;&amp; printf "\004" &amp;&amp; exit 0
    exit 2
 fi
 </code>
>Release-Note:
>Audit-Trail:

From: Sergei Laskavy <laskavy@Gambit.Msk.SU>
To: ohashi@mickey.ai.kyutech.ac.jp
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: docs/8757: psif in printing.sgml in Handbook
Date: 19 Nov 1998 14:21:38 +0300

 ohashi@mickey.ai.kyutech.ac.jp writes:
 
 > >Description:
 > 
 > psif expands unexpected wildcard characters in some files.
 > 
 > For example, if C source codes start with "/*" characters,
 > it will be expanded files in the root directory.
 > 
 > To avoide this unexpected expansion, replace printf with echo.
 > 
 > >How-To-Repeat:
 > 
 > Install psif as an input filter for a PS printer
 >  % cat "/* comment */" | lpr
 > or
 >  % cat "/* comment */" | /usr/local/libexec/psif |gs -
 > 
 > >Fix:
 > 
 > --- printing.sgml.orig	Thu Nov 19 14:58:11 1998
 > +++ printing.sgml	Thu Nov 19 14:59:11 1998
 > @@ -2245,13 +2245,13 @@
 >     #
 >     #  PostScript job, print it.
 >     #
 > -   echo $first_line &amp;&amp; cat &amp;&amp; printf "\004" &amp;&amp; exit 0
 > +   printf "%s\n" "$first_line" &amp;&amp; cat &amp;&amp; printf
 > "\004" &amp;&amp; exit 0
 
 printf is not a fix
 
 A real fix is
 
 	echo "$first_line"
 
 instead of
 
 	echo $first_line
 
 -- 
 FreeBSD Project: http://FreeBSD.org/docproj/    Vim: http://www.vim.org/
 $_='$6C86:P$^P|2D<2GJPl=2D<2GJp82>3:E^>D<^DFn';tr#P-~\x20-O#\x20-~#;print

From: Takeshi OHASHI <ohashi@mickey.ai.kyutech.ac.jp>
To: laskavy@Gambit.Msk.SU
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: docs/8757: psif in printing.sgml in Handbook
Date: Fri, 20 Nov 1998 11:09:27 +0900 (JST)

 >>   Cc: FreeBSD-gnats-submit@FreeBSD.ORG
 >>   References: <199811190614.PAA17241@ateken2.mickey.ai.kyutech.ac.jp>
 >>   From: Sergei Laskavy <laskavy@Gambit.Msk.SU>
 >>
 >>   printf is not a fix
 >> 
 >>    A real fix is
 >> 
 >>	   echo "$first_line"
 >> 
 >>    instead of
 >> 
 >> 	   echo $first_line
 
 I agree. Quotation is the best in this case.
 
 P.S. I am so sorry that I missed confidential condition in send-pr.
 --
 Takeshi OHASHI, Dept. of A.I., Kyushu Inst. of Tech., Iizuka 820, JAPAN
 ohashi@mickey.ai.kyutech.ac.jp  TEL:+81-948-29-7635 FAX:+81-948-29-7601
State-Changed-From-To: open->closed 
State-Changed-By: billf 
State-Changed-When: Tue Dec 8 14:08:59 PST 1998 
State-Changed-Why:  
Updated in doc/handbook/printing.sgml, expamples/printing ifhp, and 
examples/printing/psif 
Thanks! 
>Unformatted:
