bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[grep] strange behavior of `grep -o'


From: Alexandre Duret-Lutz
Subject: [grep] strange behavior of `grep -o'
Date: Mon, 24 Oct 2005 07:45:20 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

This looks unexpected to me:

% echo 1234 | grep -o '^[0-9]'
1                                    
2
3
4
% grep --version
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.


Because `-o' is documented as `show only the part of a line matching PATTERN',
I would expect only `1' to be output.
-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]