home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!UB.com!pacbell.com!sgiblab!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!news.funet.fi!news.cs.tut.fi!mn87537
- From: mn87537@cs.tut.fi (Marko Nordberg)
- Newsgroups: comp.infosystems.gopher
- Subject: Re: Help With Search Mechanisim
- Date: 27 Jan 1993 07:03:40 GMT
- Organization: Tampere University of Technology
- Lines: 43
- Distribution: world
- Message-ID: <1k5c4cINN7qp@cs.tut.fi>
- References: <1993Jan27.004025.27198@muddcs.claremont.edu>
- NNTP-Posting-Host: kaarne.cs.tut.fi
-
- In article <1993Jan27.004025.27198@muddcs.claremont.edu> you write:
- >Hi,
- >I am trying to establish a search which will return the results of a grep
- >on a file. Here is my setup:
-
- ...
-
- And here is my setup:
-
- In gopher-data directory I have this file
-
- #!/bin/sh
- echo=/usr/5bin/echo
- $echo "0Hakutulos tekstist{
- $1\texec:\"$1\":/bin/puhluet\tcc.tut.fi\t70"
- $echo ".\r"
-
- And in .cap subdirectory file with the same name as the previous file
-
- Type=7
-
- And command 'puhluet' comes from the gopher-data/bin directory
-
- #!/bin/sh
- cat bin/puhluet.dat | tr '\204\224\231\216\206\217' '{|\[}]' | egrep -i "$1"
-
- as you can see, it also translates characters from IBM-international
- character set to corresponding replacement characters in 7-bit ASCII.
- and file puhluet.dat is file which i am grepping. It is a telephone
- catalog with one item in a line.
-
- Remember that gopher can not see files above it's own data directory.
- You must have all necessary items in gopher's own bin. However you can
- use links and refer to files in the outside world in your scripts if
- you have started gopher with the -c option. This is a security risk,
- because if you invent to use general search grep which takes file name
- as one parameter then it is very easy to search also your /etc/passwd
- file.
-
- --
- ______________________________________________________________________
- ! Marko Nordberg, Aaltosenkatu 29 A 2, 33500 TRE ! "Puhun omiani" !
- ! markon@cc.tut.fi mn87537@cs.tut.fi (931) 557 171 ! -MN- !
-