summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstanley lieber <stanley.lieber@gmail.com>2012-07-05 13:12:04 -0500
committerstanley lieber <stanley.lieber@gmail.com>2012-07-05 13:12:04 -0500
commitb6993361e05683bc61ce69800f802495e682e5bb (patch)
tree431143d80c868caa49fad61d9e515a40de6e16b7
parent1e04852c3d528234966984b703487c9209d163fe (diff)
g: expand matched files list and add to grep(1) man page
-rw-r--r--rc/bin/g2
-rw-r--r--sys/man/1/grep25
2 files changed, 25 insertions, 2 deletions
diff --git a/rc/bin/g b/rc/bin/g
index e75da7310..a7ac8b146 100644
--- a/rc/bin/g
+++ b/rc/bin/g
@@ -14,7 +14,7 @@ case 0
exit usage
case 1
pattern=$1
- files=(`{ls *.[bcChm] *.cc *.py *.tex *.ms *.java >[2]/dev/null})
+ files=(`{ls *.[bcChlmy] *.asm *.cc *.cs *.lx *.cgi *.pl *.py *.tex *.ms *.java *.xy *.go *.goc >[2]/dev/null})
case *
pattern=$1
shift
diff --git a/sys/man/1/grep b/sys/man/1/grep
index 8bf2455ee..0806051d9 100644
--- a/sys/man/1/grep
+++ b/sys/man/1/grep
@@ -1,6 +1,6 @@
.TH GREP 1
.SH NAME
-grep \- search a file for a pattern
+grep, g \- search a file for a pattern
.SH SYNOPSIS
.B grep
[
@@ -16,6 +16,15 @@ grep \- search a file for a pattern
[
.I file ...
]
+.br
+.B g
+[
+.B flags
+]
+.I pattern
+[
+.I file ...
+]
.SH DESCRIPTION
.I Grep\^
searches the input
@@ -96,8 +105,22 @@ in single quotes
An expression starting with '*'
will treat the rest of the expression
as literal characters.
+.PP
+.I G\^
+invokes
+.I grep
+with
+.B -n
+(plus aditional flags, if provided)
+and forces tagging of output lines by file name. If no files
+are listed, it searches all files matching
+.B *.asm *.cc *.cs *.lx *.cgi *.pl
+.B *.py *.tex *.ms *.java *.xy *.go
+.B *.goc
.SH SOURCE
.B /sys/src/cmd/grep
+.br
+.B /rc/bin/g
.SH SEE ALSO
.IR ed (1),
.IR awk (1),