projects
/
shellsnippets
/
shellsnippets.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
project home
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
update from MirBSD CVS
[shellsnippets/shellsnippets.git]
/
mksh
/
bmgrep
1
#!/bin/mksh
2
set -A args
3
blub=0
4
for x in "$@"; do
5
case $blub:$x {
6
(0:--)
7
blub=1
8
;;
9
(0:-*)
10
args[${#args[*]}]=$x
11
;;
12
(*)
13
args[${#args[*]}]=-e
14
args[${#args[*]}]=$x
15
;;
16
}
17
done
18
wc -l ~/.etc/*.htm
19
print -ru2 -- + fgrep "${args[@]}"
20
exec fgrep -n "${args[@]}" -- ~/.etc/*.htm