/[Frey]/trunk/bin/grep-iselect.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/bin/grep-iselect.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1037 - (show annotations)
Sun Feb 8 12:24:46 2009 UTC (13 years, 11 months ago) by dpavlin
File MIME type: application/x-sh
File size: 551 byte(s)
added static/*.*
1 #!/bin/sh
2
3 # usage: ./bin/grep-iselect.sh something -C 3
4
5 test -z "$1" && exit
6
7 select=tmp/grep
8 grep="grep -rni $@ '*.[Pp][MmLl] bin/ lib/ static/Frey/ static/*.* t/ etc/"
9 $grep | sed 's/^\([^ ]*:[0-9][0-9]*:[ ^]*\)/{s}\1/' > $select
10 if [ ! -s $silect ] ; then
11 echo "no results for $grep"
12 exit
13 fi
14
15 echo "# "`ls -al $select`
16
17 opt=''
18 if ! grep -q '{s}' $select ; then
19 opt='-a'
20 fi
21
22 line=`cat $select | sed 's/{\(s[^}]\)/{ \1/g' | iselect -d '{,}' $opt -t 'vi file'`
23 echo "# $line"
24 test ! -z "$line" && vi `echo $line | sed -e 's/:/ +/' -e 's/:.*$//'`

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26