home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / infosyst / gopher / 2104 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.0 KB

  1. 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
  2. From: mn87537@cs.tut.fi (Marko Nordberg)
  3. Newsgroups: comp.infosystems.gopher
  4. Subject: Re: Help With Search Mechanisim
  5. Date: 27 Jan 1993 07:03:40 GMT
  6. Organization: Tampere University of Technology
  7. Lines: 43
  8. Distribution: world
  9. Message-ID: <1k5c4cINN7qp@cs.tut.fi>
  10. References: <1993Jan27.004025.27198@muddcs.claremont.edu>
  11. NNTP-Posting-Host: kaarne.cs.tut.fi
  12.  
  13. In article <1993Jan27.004025.27198@muddcs.claremont.edu> you write:
  14. >Hi,
  15. >I am trying to establish a search which will return the results of a grep  
  16. >on a file. Here is my setup:
  17.  
  18. ...
  19.  
  20. And here is my setup:
  21.  
  22. In gopher-data directory I have this file
  23.  
  24. #!/bin/sh
  25. echo=/usr/5bin/echo
  26. $echo "0Hakutulos tekstist{
  27. $1\texec:\"$1\":/bin/puhluet\tcc.tut.fi\t70"
  28. $echo ".\r"
  29.  
  30. And in .cap subdirectory file with the same name as the previous file
  31.  
  32. Type=7
  33.  
  34. And command 'puhluet' comes from the gopher-data/bin directory
  35.  
  36. #!/bin/sh
  37. cat bin/puhluet.dat | tr '\204\224\231\216\206\217' '{|\[}]' | egrep -i "$1"
  38.  
  39. as you can see, it also translates characters from IBM-international
  40. character set to corresponding replacement characters in 7-bit ASCII.
  41. and file puhluet.dat is file which i am grepping. It is a telephone
  42. catalog with one item in a line.
  43.  
  44. Remember that gopher can not see files above it's own data directory.
  45. You must have all necessary items in gopher's own bin. However you can
  46. use links and refer to files in the outside world in your scripts if
  47. you have started gopher with the -c option. This is a security risk,
  48. because if you invent to use general search grep which takes file name
  49. as one parameter then it is very easy to search also your /etc/passwd
  50. file.
  51.  
  52. -- 
  53. ______________________________________________________________________
  54. ! Marko Nordberg, Aaltosenkatu 29 A 2, 33500 TRE    ! "Puhun omiani" !
  55. ! markon@cc.tut.fi mn87537@cs.tut.fi (931) 557 171  !         -MN-   !
  56.