view etc/grep.txt @ 83397:693e794b57bf

Merged from miles@gnu.org--gnu-2005 (patch 149-151, 629-641) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-629 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-631 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-632 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-633 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-634 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-635 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-636 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-637 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-638 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-639 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-640 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-641 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-149 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-150 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-151 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-437
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 07 Nov 2005 14:56:19 +0000
parents 4fc385f4c685
children 3681678d3d86
line wrap: on
line source

* Introduction  -*-grep-*-

This shows the different kinds of messages grep recognizes by default and
how they are rendered.  It is intended both to help you decide which matchers
you need and as a test of the matchers.  Move the mouse over a colored part
to see how much text was actually matched.

Please do not edit this file in grep-mode, it may lose escape
sequences on saving.  Visit this file literally for editing.


* GNU grep 2.5.1

grep -nH -e "INFO tree" ../info/*
../info/dir:6:File: dir	Node: Top	This is the top of the INFO tree

* GNU grep 2.5.1 with default colors

grep -nH --color=always -e "INFO tree" ../info/*
../info/dir:6:File: dir	Node: Top	This is the top of the INFO tree

* GNU grep 2.5.1-cvs with the specified matching color

GREP_COLORS='mt=01;31:fn=:ln=:bn=:se=:ml=:cx=:ne' grep -nH --color=always -e "INFO tree" ../info/*
../info/dir:6:File: dir	Node: Top	This is the top of the INFO tree

* GNU grep 2.5.1-cvs with colors for the file name, line number and match

GREP_COLORS='mt=01;31:fn=35:ln=32:bn=:se=:ml=36:cx=37:ne' grep -nH --color=always -e "INFO tree" ../info/*
../info/dir:6:File: dir	Node: Top	This is the top of the INFO tree
1:2:3:4:text
1:2:3:4:text
1:2:3:4:text

* GNU grep 2.5.1-cvs with default colors

grep -nH --color=always -e "INFO tree" ../info/*
../info/dir:6:File: dir	Node: Top	This is the top of the INFO tree

* GNU grep 2.5.1 on lines starting with a number and colon

grep -nH -e "Universal Time" ../lispref/*
../lispref/os.texi:1010:0:00 January 1, 1970 UTC (Coordinated Universal Time)

* GNU grep 2.5.1 with context lines

grep -C 2 -nH --color=always -e "INFO tree" ../info/*
../info/dir-4-looking at that node, which is (dir)Top.
../info/dir-5-
../info/dir:6:File: dir	Node: Top	This is the top of the INFO tree
../info/dir-7-
../info/dir-8-The Info Directory

* GNU grep 2.5.1 on files recognized as binary

Binary file emacs-7 matches
Binary file 2005-06 matches

* GNU grep 2.5.1: other messages

Grep started at Tue Jul 19 15:41:30
grep: ../info/dirinfo: No such file or directory
Grep interrupt at Tue Jul 19 15:42:31
Grep killed at Tue Jul 19 15:42:31
Grep terminated at Tue Jul 19 15:42:31
Grep exited abnormally with code 2 at Tue Jul 19 15:42:31
Grep finished with no matches found at Tue Jul 19 15:43:12
Grep finished (matches found) at Thu Jul 21 15:02:15

* agrep

agrep -n "INFO tree" ../info/*
../info/dir: 6: File: dir	Node: Top	This is the top of the INFO tree

* unknown greps

grep -nH -e "xyzxyz" ../info/*
../info/emacs-2:1205:10:inserts `xyzxyzxyzxyz' in the current buffer.
../info/emacs-2:1205:10-15:inserts `xyzxyzxyzxyz' in the current buffer.
../info/emacs-2:1205.10-1205.15:inserts `xyzxyzxyzxyz' in the current buffer.
../info/emacs-2 1205.10-15 inserts `xyzxyzxyzxyz' in the current buffer.
../info/emacs-2 1205.10-1205.15 inserts `xyzxyzxyzxyz' in the current buffer.
../info/emacs-2 1205 inserts `xyzxyzxyzxyz' in the current buffer.

;;; Local Variables:
;;; buffer-read-only: t
;;; End: