Subject: bin/2324: more adds escape sequences even when output is to file
To: None <gnats-bugs@NetBSD.ORG>
From: Arne Henrik Juul <arnej@imf.unit.no>
List: netbsd-bugs
Date: 04/13/1996 21:47:52
>Number:         2324
>Category:       bin
>Synopsis:       more adds escape sequences even when output is to file
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 13 16:20:01 1996
>Last-Modified:
>Originator:     Arne H. Juul
>Organization:
	Norwegian University of Technology and Science
>Release:        NetBSD-current, Sat Apr 13 21:41:55 MET DST 1996
>Environment:
	
System: NetBSD leon.imf.unit.no 1.1B NetBSD 1.1B (LEON) #0: Sat Apr 6 13:42:48 MET DST 1996 arnej@leon.imf.unit.no:/usr/src/sys/arch/i386/compile/LEON i386


>Description:
	When 'more' is used but output is not to a terminal, it
should behave like 'cat', but it outputs escape sequences.  I often
do some pipe producing output with |more (or |less), and sometimes
when continuing the pipeline or redirecting to file, I skip deleting
the extra |more, and this used to work just as well (a small performance
penalty, of course).

>How-To-Repeat:
	
leon:/tmp:(331)$ diff -ru /usr/src/etc/mtree/special /etc/mtree/special | more > file
leon:/tmp:(332)$ tail -2 file | od -c
0000000        .   .  \t   #   v   a   r   /   s   p   o   o   l  \n 033
0000020    [   2   4   ;   1   H 033   [   K            

Note the extra escape sequence.  It also does it if piping directly, like
diff -ru /usr/src/etc/mtree/special /etc/mtree/special | more | tail -2 file | od -c

>Fix:
	Unknown.
>Audit-Trail:
>Unformatted: