nago.sh is a small shell script working as a command-line Gopher client.
It makes use of command line tools part of standard Unix systems, and is a somewhat ugly hack I wrote as a personal exercise. However, so far I have not yet encountered a Gopher server where it did not work. If it fails somewhere, please report server and selector!
nago.sh without arguments to get a short help:
usage: nago.sh [-h|<server>] [<directory> <port>] where <server> is a server in gopherspace, <directory> a subdir on it, and <port> the port to connect to (default 70) e.g: nago.sh sdf.lonestar.org /users/yargo -h uses environment variable GOPHER_HOME as starting point (currently ), or if that is empty, sdf.lonestar.org/ (only default port 70 is supported, and must be a directory) Note: will not work for retrieving a file directly! (undefined behaviour)
If you want to set the '-h' starting point, you should set
a value like
gopher.floodgap.com/world — please note this "home" does not
permit any other port than 70.
-h or server+directory are given, the script will fetch that page,
display it (with the use of
less) and wait for commands.
If the page is a document, the script will permit to locally save it, then return to the directory above it. If the page is a directory, the script will offer the following command possibilities:
Entering an empty command is the same as entering 0 or b, i.e back; if there is no previous directory in the history, the script will quit.
At the beginning of the script, handlers for various selector types must be defined, as well as the program to fetch gopher data (netcat/socat/snarf for example).
Several versions are available, all but one commented out; please uncomment a tool available on your system, and comment/remove the others. In the netcat version, the environment variable NETCAT will be used if set. If you implement another type, I would love to hear about your solution!