Newsgroups: fj.questions.unix
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!etlnews.etl.go.jp!etlinn.etl.go.jp!etl.go.jp!trc.rwcp!rwc-tyo!nf4.iij.ad.jp!news.iij.ad.jp!nr1.scn.co.jp!sinfony-news!news.kddnet.ad.jp!news.dvlp.kddnet.ad.jp!news.cs.ritsumei.ac.jp!kuis-news!kudpc!sakunami!chiba-ns!news.chiba-u.ac.jp!eclnews!sinetnews!news.nacsis.ac.jp!alps!cryst!escargot!t-server!mech.t.u-tokyo.ac.jp!is.s.u-tokyo!zion.phys.s.u-tokyo.ac.jp!news.nc.u-tokyo.ac.jp!news.iis.u-tokyo!isspsun!news
From: aonuma@kappa.issp.u-tokyo.ac.jp (Shuji AONUMA)
Subject: Re: search engine on Unix (Solaris)
Message-ID: <969j5iT.aonuma@kappa.issp.u-tokyo.ac.jp>
To: hideki@kuiae.kyoto-u.ac.jp
Sender: news@isspsun.issp.u-tokyo.ac.jp
Organization: Institute for Solid State Physics, Tokyo, Japan
References: <51re7l$d7p@sal92.kuiae.kyoto-u.ac.jp>
Date: Thu, 19 Sep 1996 20:28:49 GMT
Lines: 163
Xref: galaxy.trc.rwcp.or.jp fj.questions.unix:6127
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.questions.unix&nb=6127&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

On fj.questions.unix, Ishimura (hideki@kuiae.kyoto-u.ac.jp) wrote:
|I> ~/public_html/ $B$N2<$N%U%!%$%k$rBP>]$K$7$F!"!V$j$s$4!W$H$$$&(B
|I> $BJ8;zNs$r8!:w$7$^$9!#8!:w7k2L$rI=<($9$k$H$H$b$K!"$G$-$l$P!"(B
|I> $B$=$N%U%!%$%k$K%j%s%/$,D%$i$l$F$[$7$$$G$9!#(B

$B$*K>$_$N$b$N$H$O$A$g$C$H0c$$$^$9$,!"(Bgrep$B$N=PNO$r(Bbrowser
$B$KEO$9%9%/%j%W%H$r;H$C$F$$$^$9!#(B

$BF|K\8l$b;n$7$F$_$?$i!"F|K\8lBP1~$N(Bgrep$B$@$C$?$N$G(BOK$B$G$7$?!#(B
$B$$$m$s$J!"4A;z%3!<%I$,:.:_$7$F$$$?$i;H$$$b$N$K(B
$B$J$i$J$$$+$bCN$l$^$;$s$,!#(B

visual grep$B$J$s$FL>A0$r$D$1$F$$$^$9$,!"(B
$BC1$K%U%!%$%kL>$K(Bfile://...$B$G%j%s%/$rD%$C$F$$$k$@$1$G$9!#(B

Lynx$B$7$+;H$C$F$$$J$$$N$G!"(Bnetscape$BEy$N(Bbrowser$B$G$b(B
$BF0$/$+$I$&$+$OCN$j$^$;$s!#(B

--  ___
  (~._.~)    
  _{ Y }_
( )_~~~_( ) $B@D>B(B $B=(;y(B
 (_)---(_) aonuma@kappa.issp.u-tokyo.ac.jp



#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1996-09-20 05:27 JST by <aonuma@kappa.issp.u-tokyo.ac.jp>.
# Source directory was `/home/katoh/aonuma/bin/temp'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#    610 -rwxr--r-- vgrep
#    240 -rwxr--r-- ls-lR.awk
#    486 -rwxr--r-- grep2html.awk
#
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo
  echo 'WARNING: not restoring timestamps.  Consider getting and'
  echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 1231235999 $$.touch
#
# ============= vgrep ==============
if test -f 'vgrep' && test X"$1" != X"-c"; then
  echo 'x - skipping vgrep (file already exists)'
else
  echo 'x - extracting vgrep (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'vgrep' &&
#!/bin/csh
# by aonuma@kappa.issp.u-tokyo.ac.jp
X
if ( $#argv < 1 ) then
Xecho "Visual Grep"
Xecho "usage:   $0 keyword"
Xexit 1
endif
X
grep $1 `ls-R.awk` | grep2html.awk > /tmp/$$.html
lynx /tmp/$$.html < /dev/tty
# netscape /tmp/$$.html < /dev/tty
# netscape$B$G$b$&$^$/$$$/$+$I$&$+$O!"%A%'%C%/$7$F$^$;$s!#(B
X
rm -f /tmp/$$.html
X
# $B@)8B;v9`(B: $B%G%#%l%/%H%j!<$N;XDj!"%U%!%$%k$N;XDj$O$G$-$^$;$s(B(ls-R.awk$B$r(B
# $BD>$;$P$G$-$k$1$I(B)$B!#8!:w$7$?$$%G%#%l%/%H%j!<$K(Bcd$B$7$F!"$=$3$G<B9T$7$F(B
# $B2<$5$$!#(B
X
# $B%P%0(B: $B8!:w%U%!%$%k$,(B1$B8D$7$+$J$$>l9g$O!"@5>o$KF0:n$7$^$;$s!#(B
X
SHAR_EOF
  $shar_touch -am 0920052296 'vgrep' &&
  chmod 0744 'vgrep' ||
  echo 'restore of vgrep failed'
  shar_count="`wc -c < 'vgrep'`"
  test 610 -eq "$shar_count" ||
    echo "vgrep: original size 610, current size $shar_count"
fi
# ============= ls-lR.awk ==============
if test -f 'ls-lR.awk' && test X"$1" != X"-c"; then
  echo 'x - skipping ls-lR.awk (file already exists)'
else
  echo 'x - extracting ls-lR.awk (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'ls-lR.awk' &&
#!/usr/bin/gawk -f 
# ls-R
# by aonuma@kappa.issp.u-tokyo.ac.jp 
X
X
BEGIN {
XDir=""
X
Xwhile ("ls -R" | getline tmp >0){
Xif (tmp ~ ":") {
Xsub(":$","",tmp)
Xsub("^./","",tmp)
XDir=tmp"/"
X}
Xelse printf("%s%s\n",Dir,tmp)
X}
Xexit
}
SHAR_EOF
  $shar_touch -am 0920052296 'ls-lR.awk' &&
  chmod 0744 'ls-lR.awk' ||
  echo 'restore of ls-lR.awk failed'
  shar_count="`wc -c < 'ls-lR.awk'`"
  test 240 -eq "$shar_count" ||
    echo "ls-lR.awk: original size 240, current size $shar_count"
fi
# ============= grep2html.awk ==============
if test -f 'grep2html.awk' && test X"$1" != X"-c"; then
  echo 'x - skipping grep2html.awk (file already exists)'
else
  echo 'x - extracting grep2html.awk (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'grep2html.awk' &&
#!/usr/bin/gawk -f
# marking-up grep output 
# by aonuma@kappa.issp.u-tokyo.ac.jp 
X
# foo: hogehoge ...
# $B$H$$$&7A<0$N(Bgrep$B$N=PNO$r(B
# <a href="file://kappa.issp.u-tokyo.ac.jp/home/katoh/aonuma/etc/foo">foo</a>hogehoge...
# $B$KJQ49$9$k!#(B
X
BEGIN{
XFS=":"
Xprint("<PRE>")
XPWD=ENVIRON["PWD"]
XHOST=ENVIRON["HOST"]
}
X
END {
Xprint("</PRE>")
}
X
($0){
XFILE=$1
XTEXT=substr($0,index($0,":")+1)
Xprintf("<a href=\"file://%s%s/%s\">%s</a>: %s\n", HOST, PWD, FILE, FILE, TEXT)
}
SHAR_EOF
  $shar_touch -am 0920052396 'grep2html.awk' &&
  chmod 0744 'grep2html.awk' ||
  echo 'restore of grep2html.awk failed'
  shar_count="`wc -c < 'grep2html.awk'`"
  test 486 -eq "$shar_count" ||
    echo "grep2html.awk: original size 486, current size $shar_count"
fi
exit 0
