README ====== Installation To install the WebShell, please follow the following steps:- 1. First uncompress and untar the file WebShell.tar.gz using commands a. "gunzip WebShell.tar.gz", then b. "tar -xvf WebShell.tar" After executing the above two commands, check that there are ? directories under WebShell directory. 2. Go to the directory /WebShell/make and type "make" to compile the WebShell. Then the installation process of WebShell is finished. How To Execute The WebShell To execute the WebShell, just type the following command >websh Usage and Application User Command webshell is a modified version of zsh2.5.03. The following commands are enhanced for the purpose of accessing the World Wide Web: NAME 1. cd - change working directory to a local directory or to a remote directory by ftp. 2. cp - copy files to the destination through different protocols to the local file system. 3. ls - list the contents of the directory in different remote servers. 4. pwd - show the current directory. SYNOPSIS 1. cd [directory] 2. cp cp [-rR] cp 3. ls [-al] 4. pwd DESCRIPTION 1. "directory" becomes the new working directory. If cd is used without argument, it returns you to your login directory. The "directory" can be a ftp directory. 2. cp copies the content of "filename1" onto "filename2". The "filename1" can be a file on a remote server. If the second form is used, cp recursively copies "directory1", along with its contents and sub-directories, to "directory2". If "directory2" does not exist, cp creates it and duplicates the files and sub-directories of "directory1" within it. If "directory2" does exist, cp makes a copy of the "directory1" directory within "directory2" (as a sub-directory), along with its files and subdirectories. The "directory1" can be a ftp directory. In the third form, "filename" is copied to the "directory"; the basename of the copy corresponds to that of the original. The destination directory must already exist for the copy to succeed. The "filename" can be on a remote server. 3. If "filename" is a directory, ls lists the contents of the directory; if "filename" is a file, ls repeats its name and any other information requested. -a List all entries; in the absence of this option, entries whose names begin with a "." are not listed. -l List in long format, giving mode, number of links, owner, size in bytes, and time of last modification for each file. 4. pwd prints the pathname of the working (current) directory. Usage 1. To copy a file on a remote server to local directory directly. example% cd ftp://remote_server/directory example% pwd ftp://remote_server/directory example% ls abc.bmp helloc.doc pqr.gif example% cd example% pwd /homes/local_directory example% ls ./src xx.c xyz.c zz.c example% cp ftp://remote_server/directory/hello.doc ./src example% ls ./src hello.src xx.c xyz.c zz.c 2. To copy all the files and sub-directories of a directory on a remote server recursively to a local directory. example% cd ftp://remote_server/directory example% pwd ftp://remote_server/directory example% ls hello.txt src xyz.c example% cd src example% ls abc.doc pqr.doc uvw.txt example% cd example% pwd /homes/local_directory example% ls fel.doc jac.doc vin.doc example% cp -r ftp://remote_server/directory . example% ls hello.txt fel.doc jac.doc src vin.doc xyz.c example% cd src example% ls abc.doc pqr.doc uvw.txt 3. To store the user name and the corresponding password after the first time logging in, and the user do not have to input his/her username and password afterward. example% cd ftp://remote_server/account Please enter username: temp_name Password: example% pwd ftp://remote_server/account example% cd example% pwd /homes/local_directory example% cd ftp://remote_server/account example% pwd ftp://remote_server/account Application After looking at some usage of the Webshell, we are going to give an example of the application that can be made. Situation I know that a weekly magazine will post its table of contents of each publication on its homepage. I want to have a look on the table of content first before I buy this magazine. Currently, I have to use a browser, connect to the site, and see the content. In such case, we can write a simple shell script on the Webshell, making use of its ability to access the Web, we can achieve this requirement easily by the shell script repeat_get. example% cat repeat_get #! ./websh # # define the time and day to get time=1700 day='thursday next week" cmd="./repeat_get" # do the copy cp http://pathfinder.com/@@D6H8iQQAftfYU2vA/time/timehomepage.html time.new # run this shell script next at 1700 next Thursday echo $cmd | at $time $day example% ls abc.c hello.txt example% date Fri May 31 21:49:04 HKT 1996 example% .\repeat_get job 25 at Thu Jun 6 19:00:00 1996 example% ls abc.c hello.txt time.new The above shell script will copy the homepage of Time magazine whenever it is run, and will call itself next Thursday. Known Bugs We have mentioned before we change the "exit" to the "return" during the clean up in W3C module. In Commenad Line Tools, the data socket connection and the TCP socket connection will all be closed as the programme exit. But the TCP socket connection do not close as the programme do not exit and return the control to the Event Loop. Therefore, the number of the sockets opened will increase as more and more execute. Once the number of the sockets reach a maximum, no more internet access will be availabe because there is no more sockets availabe for data and TCP connection. But the command still work when it do not involve internet access. Enhancement 1. Beceuase we don't we have enough time, we can't solve the bug mentioned in the Known Bugs, it is better to find a method to close the TCP connection for every internet access without exit the programme. 2. The approach we are using now is a high level retrieval algorithm. For every time we want a file or listing, we will call W3C module to retrieve the data object. If we want to retrieve several data objects from the same remote server, we still need to call W3C several times, so it need to connect and disconnect the connection several times. For a more time saving approach, is to use a lower level socket connection method to connect the remote server, to retrieve all the files needed and close the connection when no more data objects need to be retrieved from the remote server. But this approach will touch the internals of the Library and will involve more study on the network control. 3. A Graphical User Interaface can be developed so that it works like a File Manager.