Documentation for NetShell
- Installation guide
- Overview
- User manual
- List of tools
- NetShell library
- Known bugs
- Troubleshooting and maintenance
- Copyright Notice
Installation Guide
- Download the source
- Make sure you have
Tk 4.0 and Perl installed.
- Untar the source:
% tar xf NetShell.tar
This will create a new directory called NetShell.
- cd NetShell
- run the nshconfig program to configure your copy:
% nshconfig
- You are all set now. Start NetShell:
% netshell
The NetShell window should appear and you can start using it.
Comments
- NetShell can be used from any UNIX/X platform running Tk 4.0 and Perl.
However, some of the example tools we currently distribute with NetShell were
compiled only on Solaris and DEC OSF/1.
We'll add more ports later.
- This is still a preliminary 0.9 version.
You can probably ignore most of the warning messages for now.
Let us (netshell@cs.arizona.edu) know if encounter any major problems.
Overview
NetShell works by viewing the WWW as just another IO stream.
In addition to accepting IO to/from files or to/from user windows,
NetShell provides an easy way to direct the IO stream to/from the web.
Each NetShell tool -- and one can very easily make up tools from
existing programs -- can be set to get its input from Netscape's current
page and sends its output to be shown on Netscape's window.
Tools can also use files or a special tty window for their input/output.
This allows one to manipulate WWW data in a very customizable and
convenient way.
For example, using the FOLD tool (enclosed with NetShell distribution),
one can with one click collect all pages pointed to from the current page
into one big page (e.g., for saving or printing).
User manual
Tools
The NetShell window shows the list of currently available tools.
When a tool is selected (by clicking on it), NetShell shows the
program the tool uses and its selection on input/output.
To execute a tool after selecting it, click on the Execute button.
This is the simplest way to use NetShell.
Tools can be easily added or edited as described below.
A list of tools distributed with NetShell appears here.
File Menu
- New Tool: a special window will pop out and will allow you
to specify a new tool. Do not forget to name your new tool.
You can try your tool before saving it by clicking on "Try it".
- New folder: a special window will pop out and will allow you
to add a new folder of tools. NetShell supports a hierarchy of folders
containing tools so you are not limited to just one linear list.
- Edit: a special window will pop out to allow you
to edit the selected tool. (Same as hitting the "Edit" button.)
- Delete: the selected item will go to the trash can.
You can reclaim it using the Reclaim operation.
- Reclaim: a box containing everything you deleted will pop out.
You can reclaim the items or move any item to the current folder
(which may be different from its original folder).
Double clicking on the trash can has the same effect.
- Execute: execute the selected tool.
(Same as hitting the Execute button.)
- History: a list of folders you have used.
Select a folder and you will go there directly.
- Exit: exits NetShell. The new/modified tools will
be saved.
Options Menu
- Hide/Show Toolbar: The Toolbar is the small area with the
three buttons and one trash can.
- Change Browser: when NetShell starts it establishes communication
with a currently running Netscape window. If there is more than one window,
or if you want to change the window later you can use this option, which
lists all opened windows.
- Show/Hide Folders: shows the list of available folders.
- Raise/NoRaise Browser: The netscape window will usually
pop out when a remote request is received.
If NoRaise Browser is chosen, the netscape window will not pop out
when processing remote request.
- Fast/Cautious Mode. In the Cautious Mode, which is the
default, all URLs are fetched from scratch.
If you choose Fast Mode, the page will be acquired directly
from the Netscape window.
The problem with Fast Mode is that sometimes the page
may not be complete or up-to-date (e.g., when a transmission is in the
middle or was interrupted).
TTY window as input
You can specify the tty window as the source of input.
Click button 1 on a segment of text in tty window, which is the
result of former execution of some tool, to select it as the tty win
input. You can also select multiple segments at the same time. Single
click of button 3 will cancel the selection of the segment. This
function is useful, for example, for editing results and putting them
back to the Netscape window.
Remote execute mode
NetShell can be executed from the regular shell (or from any program)
without using the GUI.
netshell -e TOOLNAME
has the same effect as executing the given TOOLNAME from the NetShell
window.
The only limitation on remote execution is that
the tty window cannot be used as input.
Remote execution can be somewhat slower,
because for each call NetShell has to
get the window id, URL address, and so on.
NetShell predefined variables
Currently 3 variables (URL, NSID and TMPDIR) are predefined by NetShell.
URL is the url that's
showing in the netscape window. NSID is the X windows id for the
Netscape window. TMPDIR is the predefined temporary file directory.
Those variables follow the Tcl convention. For example,
you can show the current URL by "echo $URL". The environment variables
can be accessed in the same way.
Some other tricks
- Unselect Operation, click once on the trash box and it will cancel
the current selection.
- Reorder List, select the item you want to move, press down the left
mouse button and move mouse up and down. That item will go with the mouse
cursor.
List of tools
The main strength of NetShell is the ability to add and customize tools
very easily. We have constructed several examples of tools, which are
included in the NetShell distribution, and described here.
We hope that people will build and distribute more useful tools.
We will keep a list of available tools that we receive citing
the contributor. Please send them to netshell@cs.arizona.edu.
- Fold: a tool to get the current page and all the pages
it refers into one page. It's useful if you want to do something like
spell check to a set of URLs. Another possible use is to print an
online document. You can 'straight' the index page and print the
result.
Command: bin/fold [-p ProcessNumber] URL
ProcessNumber
tells how many child processes you want to fork (to fetch the
URLs).
- DES decrypt: a simple example of using existing
encryption/decryption to publish confidential information on the web.
- History viewer:
a tool written in Tcl/Tk. This tool can show the trace of
the URLs you have viewed as a tree.
- Frame: a tool to get the current page and all the pages it
refers and organize them in a simple frame structure. It's useful if
you want to browser a lot of pages(FAQs, maybe) but don't want to go
back and forth again and again. Note: it doesn't work properly if the
pages contains frame content themselves. (Don't) Try to frame the
http://home.netscape.com/ and you may know something funny things for
Javascript.
- Get text from Netscape:
a tool to get the Text version of current page. You can also modify the
tool to get the Postscript or HTML version of the pages.
- Unformatted list of links: collect all the links included
in the current page.
- Formatted list of links: collect all the links included
in the current page, and show it formatted in HTML.
- Unformatted list of images: get a list of URLs for images
in current page.
- Formatted list of images: get a list of URLs for images
in the current page, and show it formatted in HTML.
- Get attribute of tag: get some attribute of specific tag.
Command: bin/get_attr [-q] -t TAGNAME -a ATTRIBUTENAME
Example: bin/get_attr -q -t A -a HREF
Function: same as bin/get_href -q
- OmniCat: simply copies the current page to wherever you want.
Here are some important details about the
I/O redirection mechanism.
- Spell Check: do spelling check on current page.
- Urlget: a Perl script used to fetch URLs.
NetShell library
We included a small HTML file lexer as library in NetShell. The source files
for the library are in NetShell/lib and the head files are in NetShell/include.
The library is built based on the
simple SGML lexer by Dan Connolly
The lexer works in this way: each time a grammer unit is returned from the
lexer, the type of this unit is out of the HTML_DATA, HTML_TAG or HTML_COMMENT.
With a tag (i.e. unit of type HTML_TAG), there is a global variable
theTag in which we saved all the information about this tag. Following
are the functions to deal with the tag we just scanned in:
void AddNewAttrib(const char * attribName)
Add a new attribute to the currentTag.
char * GetAttrib(const char * attribName)
Get the value of the paticular attribute. Return NULL if no such attribute
or no value for this attribute(e.g. ISMAP).
int SetAttrib(const char * attribName, const char * newValue)
Set the value of the attribute with newValue.
char * Tag2String(char * buf)
Convert the tag to string and save it in buf.
Following function is used to output the just scanned unit to a file:
int Output(FILE *, int unit_type)
In NetShell/hextract we also included the source code for some tools.
This lexer is used in most of these tools.
Known bugs
- Semicolon doesn't work: if you put a semicolon between 2 commands
to execute them one by one, it won't work. I am working on it.
The way to get around: write a shell script.
- Folder doesn't work in remote mode:
you cannot invoke a tool that's not in the home folder.
The problem is I haven't figure out a intuitive way to express the
folder structure from the command line.
Troubleshooting and maintenance
- NetShell fails to find the current URL correctly -- Check if you
set the [netscape][option][show location].
- Netscape always says it can't open some temporary files -- Check if
the netshell and the netscape associated with the netshell are running
on the same machine.
- NetShell shows that the Netscape complains about version number mismatch.
Usually it caused by the same reason of above item. Netscape 2.01 is much
more strict with the version number.
- Netscape shows alert for some errors of JavaScript like:
Register not a function.
If you are using Netscape 2.01, you can just simply disable the JavaScript
to get around.
NetShell was developed by
dachuan Zhang and
Udi Manber
at
University of Arizona, Dept. of Computer Science.