diff options
author | rsc <devnull@localhost> | 2004-03-25 23:03:22 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-03-25 23:03:22 +0000 |
commit | cb27443abf3d6af6ab52377c71c843e619928433 (patch) | |
tree | 437129c581c3a2fbee75c5e52388b2bcf1cedb5e /bin/g | |
parent | 0023dde3260f4d6b085bed7d90bf8b1ca0daf77b (diff) | |
download | plan9port-cb27443abf3d6af6ab52377c71c843e619928433.tar.gz plan9port-cb27443abf3d6af6ab52377c71c843e619928433.tar.bz2 plan9port-cb27443abf3d6af6ab52377c71c843e619928433.zip |
Today's changes.
Diffstat (limited to 'bin/g')
-rwxr-xr-x | bin/g | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +#!/usr/local/plan9/bin/rc + +flags=() +while(! ~ $#* 1 && ~ $1 -*){ + flags=($flags $1) + shift +} + +switch($#*){ +case 0 + echo 'usage: g [flags] pattern [files]' >[1=2] + exit 1 +case 1 + 9grep -n $flags -- $1 *.[Cbchm] *.cc *.py *.tex *.ms *.java /dev/null \ + |[2] {9grep -v '^(grep: can''t open \*|grep: \*\.)' >[1=2]; status=0} +case * + 9grep -n $flags -- $* /dev/null +} + |