home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / alt / gopher / 1131 < prev    next >
Encoding:
Text File  |  1992-07-31  |  2.2 KB  |  61 lines

  1. Newsgroups: alt.gopher
  2. Path: sparky!uunet!noc.near.net!ns.draper.com!news.draper.com!MVS.draper.com!SEB1525
  3. From: SEB1525@MVS.draper.com (Steve Bacher)
  4. Subject: Re: Executing other applications through gopher
  5. Message-ID: <19920731080701SEB1525@MVS.draper.com>
  6. Sender: MVS NNTP News Reader <NNMVS@MVS.draper.com>
  7. Nntp-Posting-Host: mvs.draper.com
  8. Organization: Draper Laboratory
  9. References: <1992Jul30.190406.22304@msuinfo.cl.msu.edu>
  10. Date: Fri, 31 Jul 1992 13:07:00 GMT
  11. Lines: 48
  12.  
  13. In article <1992Jul30.190406.22304@msuinfo.cl.msu.edu>,
  14. schafers@cps.msu.edu.cps.msu.edu (Steven R Schafer) writes:
  15.  
  16. >I was wondering if it is possible, and if so how would you do it, to run
  17. >another application from gopher.  Let's say wais or www, maybe by using
  18. >exec in a .link file or something similar.
  19.  
  20. From the man page for gopherd:
  21.  
  22.      Another neat thing you can do is to execute commands:
  23.  
  24.          Name=Execed command name
  25.          Type={a type}
  26.          Path=exec:"args":/scriptname
  27.          Host=+
  28.          Path=+
  29.  
  30.      This is usually used by other types of gateway scripts.  For
  31.      instance, The first script might take a search and get a few
  32.      hits.  It could then  generate  "exec"  scripts  that  would
  33.      retrieve the actual document the hit referred to.
  34.  
  35. (end of man page extract)
  36.  
  37. Note that the args precede the shell script name.
  38.  
  39. Also, if the file in a directory being served by gopher is an
  40. executable shell script, the gopher server will automatically
  41. execute that shell script.  (Watch out for this "feature"!)
  42. Unfortunately, it seems that gopherd currently checks this by
  43. looking for "#!/bin/<shellutilityname>" instead of checking
  44. the permissions of the file.
  45.  
  46. When a shell script is executed, the standard output from the
  47. execution becomes the gopher data returned to the client.
  48. (The standard error is also returned to the client, and it
  49. tends to be mixed in with the standard output, which can be
  50. a problem.)  If the menu entry is requesting a directory,
  51. the script should write lines of the form
  52.  
  53. <type><name><tab><path><tab><host><tab><port>
  54.  
  55. so that the client will be able to interpret them as gopher
  56. directory entries.
  57.  
  58. --
  59. Steve Bacher (Batchman)                 Draper Laboratory
  60. Internet: seb@draper.com                Cambridge, MA, USA
  61.