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