Public bug reported:

Binary package hint: grep

Adding -i with --color causes grep to hang:

$ true && (
set -x
lsb_release -rd
locale
dpkg -l grep
grep -V

# with -i
echo hello | grep -i -e ^
# with --color
echo hello | grep --color=always -e ^
# with --color and -i
echo hello | grep -i --color=always -e ^ | hexdump -C | head -10
) &> output.txt

$ cat output.txt 
+ lsb_release -rd
Description:    Ubuntu 7.10
Release:        7.10
+ locale
LANG=en_US.UTF-8
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C
+ dpkg -l grep
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version           Description
+++-==============-=================-============================================
ii  grep           2.5.1.ds2-6build1 GNU grep, egrep and fgrep
+ grep -V
grep (GNU grep) 2.5.1

Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

+ echo hello
+ grep -i -e '^'
hello
+ echo hello
+ grep --color=always -e '^'
hello
+ echo hello
+ grep -i --color=always -e '^'
+ hexdump -C
+ head -10
00000000  1b 5b 30 31 3b 33 31 6d  1b 5b 30 30 6d 1b 5b 30  |.[01;31m.[00m.[0|
00000010  31 3b 33 31 6d 1b 5b 30  30 6d 1b 5b 30 31 3b 33  |1;31m.[00m.[01;3|
00000020  31 6d 1b 5b 30 30 6d 1b  5b 30 31 3b 33 31 6d 1b  |1m.[00m.[01;31m.|
00000030  5b 30 30 6d 1b 5b 30 31  3b 33 31 6d 1b 5b 30 30  |[00m.[01;31m.[00|
00000040  6d 1b 5b 30 31 3b 33 31  6d 1b 5b 30 30 6d 1b 5b  |m.[01;31m.[00m.[|
00000050  30 31 3b 33 31 6d 1b 5b  30 30 6d 1b 5b 30 31 3b  |01;31m.[00m.[01;|
00000060  33 31 6d 1b 5b 30 30 6d  1b 5b 30 31 3b 33 31 6d  |31m.[00m.[01;31m|
00000070  1b 5b 30 30 6d 1b 5b 30  31 3b 33 31 6d 1b 5b 30  |.[00m.[01;31m.[0|
00000080  30 6d 1b 5b 30 31 3b 33  31 6d 1b 5b 30 30 6d 1b  |0m.[01;31m.[00m.|
00000090  5b 30 31 3b 33 31 6d 1b  5b 30 30 6d 1b 5b 30 31  |[01;31m.[00m.[01|

Regards,
- Robert

** Affects: grep (Ubuntu)
     Importance: Undecided
         Status: New

-- 
grep hangs if using both the -i (--ignore-case) and --color options
https://bugs.launchpad.net/bugs/217414
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to