Re: [bsdgrep] outputs color sequences even when stdout is not tty

2010-07-24 Thread Gabor Kovesdan



I think it should behave like ls(1) and gnu grep(1) and strip color
sequences if stdout is not associated with terminal.
   
Thanks for letting me know about this. The fix is being worked on just 
like for the -q/-l bug.


Gabor
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


[bsdgrep] outputs color sequences even when stdout is not tty

2010-07-23 Thread Anonymous
I've got a breakage in bin/csh

  $ make depend
  grep '[FV]_' /usr/src/bin/csh/../../contrib/tcsh/ed.defns.c | grep '^#define' 
>> ed.defns.h
  grep 'ERR_' /usr/src/bin/csh/../../contrib/tcsh/sh.err.c | grep '^#define' >> 
sh.err.h
  cc -E -O2 -pipe -march=native -I. -I/usr/src/bin/csh 
-I/usr/src/bin/csh/../../contrib/tcsh -D_PATH_TCSHELL='"/bin/csh"' 
-DNO_NLS_CATALOGS -ggdb -std=gnu99 -fstack-protector -Wno-pointer-sign 
/usr/src/bin/csh/../../contrib/tcsh/tc.const.c 
/usr/src/bin/csh/../../contrib/tcsh/sh.char.h /usr/src/bin/csh/config.h 
/usr/src/bin/csh/../../contrib/tcsh/config_f.h 
/usr/src/bin/csh/../../contrib/tcsh/sh.types.h sh.err.h -D_h_tc_const | grep 
'Char STR' |  sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' |  
sort >> tc.const.h
  cc -o gethost  -O2 -pipe -march=native -I. -I/usr/src/bin/csh 
-I/usr/src/bin/csh/../../contrib/tcsh -D_PATH_TCSHELL='"/bin/csh"' 
-DNO_NLS_CATALOGS -ggdb -std=gnu99 -fstack-protector -Wno-pointer-sign 
/usr/src/bin/csh/../../contrib/tcsh/gethost.c
  In file included from /usr/src/bin/csh/../../contrib/tcsh/sh.h:488:0,
   from /usr/src/bin/csh/../../contrib/tcsh/gethost.c:33:
  ./sh.err.h:4:1: error: stray '\33' in program
  ./sh.err.h:4:2: error: expected identifier or '(' before '[' token
  ./sh.err.h:4:5: error: invalid suffix "m" on integer constant
  ./sh.err.h:4:5: error: expected identifier or '(' before numeric constant
  ...

  $ vis $(make -V .OBJDIR)/sh.err.h | head
  /* Do not edit this file, make creates it. */
  #ifndef _h_sh_err
  #define _h_sh_err
  \^[[1;33m\^[[K#define\^[[m\^[[K \^[[1;33m\^[[KERR_\^[[m\^[[KFLAGS   
0xf000
  \^[[1;33m\^[[K#define\^[[m\^[[K \^[[1;33m\^[[KERR_\^[[m\^[[KNAME
0x1000
  \^[[1;33m\^[[K#define\^[[m\^[[K \^[[1;33m\^[[KERR_\^[[m\^[[KSILENT  
0x2000
  \^[[1;33m\^[[K#define\^[[m\^[[K \^[[1;33m\^[[KERR_\^[[m\^[[KOLD 
0x4000
  \^[[1;33m\^[[K#define\^[[m\^[[K \^[[1;33m\^[[KERR_\^[[m\^[[KSYNTAX  0

  $ printenv | fgrep -i grep
  GREP_COLOR=1;33
  GREP_OPTIONS=--color --exclude \*.svn\*

I think it should behave like ls(1) and gnu grep(1) and strip color
sequences if stdout is not associated with terminal.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"