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

  1. Path: sparky!uunet!cs.utexas.edu!asuvax!ncar!noao!arizona!arizona.edu!zippy.telcom.arizona.edu!ptolemy.ccit.arizona.edu!user
  2. From:  (Tim Conery)
  3. Newsgroups: comp.infosystems.gopher
  4. Subject: Re: Anyway to pass args from user to shell script being exec'ed?
  5. Message-ID: <1jp7feINNhj6@zippy.telcom.arizona.edu>
  6. Date: 22 Jan 93 16:30:38 GMT
  7. References: <ellis.727665624@nova>
  8. Followup-To: comp.infosystems.gopher
  9. Organization: University of Arizona
  10. Lines: 67
  11. NNTP-Posting-Host: ptolemy.ccit.arizona.edu
  12.  
  13. In article <ellis.727665624@nova>, ellis@nova.gmi.edu (Stew Ellis) wrote:
  14. > I am setting up a gopher using gopher 1.1.  Currently it is not exported.
  15. > I am finally beginning to understand the parameters of the exec capability.
  16. > I have one exec from my top level menu that consists of the Perl script that
  17. > retrieves the weather from UofMICH for one city.  This works properly.  I
  18. > then have a link to the UIUC weather gopher for those who want interactive
  19. > weather.
  20. > What I am trying to figure out now is whether I can run my own phone
  21. > directory program that was originally designed for shell command-line usage.
  22. > If called with only one non-switch arg, this C program looks only at the
  23. > lastname field, starting with the first position.  If I liked the behavior
  24. > of cso/ph/qi better, I would invest the effort to get that working, but at
  25. > one institution searching for all ellises picked up both firstname and
  26. > lastname ellises, as well as everyone in Ellison Hall.  That is completely
  27. > unacceptable in my view.
  28. > Something I read somewhere led me to believe that I could simply declare the
  29. > link to be type 7 and that the search arg would be passed to the script as
  30. > arg1.  This is not working for me.  Is there some way of accomplishing this?
  31. > Short of rewriting the C code for search and exec?
  32. > If there is currently no way of doing this it seems like it would be a real
  33. > useful feature.  Has this been discussed?
  34. > Thanks for any suggestions or discussion.
  35. > --
  36. >                                                           ___________________
  37. >   R.Stewart(Stew) Ellis, Assoc.Prof., (Off)313-762-9765  /   _____  ______ 
  38. >   Humanities & Social Science,  GMI Eng.& Mgmt. Inst.   /        / /  /  / /
  39. >   Flint, MI 48504      ellis@nova.gmi.edu              /________/ /  /  / /
  40.  
  41. Gopher can pass arguments into shell scripts one of two ways that I know
  42. about.
  43.  
  44. One way is by providing the arguments in the cap file.
  45.  
  46. Host=+
  47. Port=+
  48. Type=0
  49. Path=exec:arguments to pass:script_name
  50. Name=Whatever
  51.  
  52. The second way is to use type 7 to query the user for the arguments.  This
  53. works
  54. fine, BUT The shell script should write out standard gopher directory
  55. protocol.
  56. I got this statement from the index.c file, this is where index types are
  57. handled.  I am still working on getting the output of the shell scripts
  58. correct.
  59.  
  60. (You may also want to look at special.c to see how the script is handled in
  61. the first exampled I gave.)
  62.  
  63. Host=+
  64. Port=+
  65. Type=7
  66. Path=7/script_name
  67. Name=whatever
  68.  
  69.  
  70. Tim Conery
  71. University of Arizona Computer Center
  72. tconery@ccit.arizona.edu
  73. us(602)621-2835
  74.