Edbrowse
Edbrowse is a combination editor, browser, and mail client that runs in command line mode. It does not display files or web pages in two dimensions across the screen; instead it accepts commands and prints responses, much like the shell. Edbrowse was modeled after ed, one of the earliest Unix editors, though there are many more features, such as editing multiple files simultaneously, and rendering web pages as text. It is a browser that acts like ed, thus the name edbrowse. This program was originally written for blind users, but many sighted users have taken advantage of its scripting capabilities. A batch job or cron job can access web pages on the internet, submit forms, and send email, with no human intervention whatsoever. Edbrowse can also tap into databases through odbc. A traditional substitute command updates the corresponding row in an sql table, and similarly for insert and delete. This open source package is included in several Linux distributions [1][2] and in FreeBSD.[3]
Command Line Philosophy
Edbrowse is part of a larger philosophy, wherein editors, browsers, mail clients, spreadsheets, and other critical applications are rewritten from the ground up if necessary to support various disabilities. This stands in contrast to the front end approach, which modifies or enhances the input/output layer and leaves the applications alone. Explorer, Outlook, and Word all run without modification, while a screen reader such as Window-Eyes converts the words or icons into speech or braille. The adapter is written once, and maintained as stand-alone software, supporting almost any application that anyone could write. This has obvious technical advantages, and is the most practical path to accessibility, but a small minority of disabled users find the experience suboptimal. A sighted user quickly locates items on the screen by moving his eyes, but the efficiency and speed of this visual interface is lost when those eye movements are replaced with a mouse and a screen reader. A command line editor, in contrast, allows the user to jump to a particular location in a file or on a web page by searching for a text fragment or regular expression. There is more typing, but less output, which some people find desirable when that output is run through the linear channel of speech or braille.
Rewriting and maintaining these large and complicated programs, such as a browser with all its plugins, is a daunting task that has received little support from government and industry to date. Still, the core of Unix and Linux consists of command line utilities, starting with the shell, and a few intrepid volunteers continue to write and maintain higher level applications such as browsers and database editors, to keep the command line philosophy alive.
History
In 2002, Karl Dahlke wrote the first version of edbrowse in perl. It lacks many important features, such as javascript support, but it has one overarching advantage, it is 100% portable. It can be run on Linux, Unix, OS X, or Windows, provided perl is installed. Thus edbrowse version 1.5.17 is still available today. It is not maintained, but curious users can run the perl version as a test, to see if they like the edbrowse interface, or the command line philosophy in general.
Version 2 provided limited javascript support through a home-grown javascript interpreter, but keeping up with the ever evolving standards of client side javascript was impractical, so in 2008 Karl wrote version 3, which incorporates the open source Spider Monkey javascript engine, also used by FireFox. This gives edbrowse an improved level of javascript support, and provides access to more websites, though a complete document object model is still under development.
Features
- Edbrowse can edit multiple files or browse multiple websites simultaneously, and transfer blocks of text between them in a manner similar to cut and paste. for instance, edbrowse *.c accesses all the C sourcefiles in the current directory.
- The regular expressions of ed have been replaced with perl compatible regular expressions, which have more power and flexibility. This simplifies the task of finding or modifying text in a large document. You can, for instance, replace each instance of the word foo, not foot or food but foo by itself, in upper or lower case, with the word bar, as long as foo is not followed by an exclamation point or a question mark. The change in regular expressions means edbrowse is not 100% backward compatible with ed, though it is close.
- Edbrowse can fetch a web page from the internet as easily as it opens a file on the current computer, using http, https, or ftp. Once the page is fetched into the active buffer, it can be browsed, or rendered as text, using the b command. This supplements the other one-letter commands which were already part of ed. Once the page is browsed, the user can go to hyperlinks or fill out and submit forms.
- The -fm option turns edbrowse into an interactive email client. It fetches mail from one or more pop3 accounts and presents these emails to the user one at a time, where they can be read, deleted, or saved to a file for future reference. Filters can automatically save certain emails to certain files, based on subject, sender, or destination email address. Other options cause edbrowse to send mail using smtp. imap is not yet implemented.
- In database mode, edbrowse can access selected rows and columns of an sql table through odbc. The insert, substitute, and delete commands of edbrowse now correspond to the insert, update, and delete operations of a database respectively. This feature is well tested on some databases, and completely untested on others. Since text editing has consequences outside the context of the current buffer, there is no undo command. When a row is deleted it is gone, without any chance of retrieval. Fortunately, referential integrity often prevents these unintended deletions.
- When editing a directory, each line of text corresponds to a file. Again, the substitute command renames a file, while the delete command removes a file, or moves it to your trash can, depending on your edbrowse configuration. There is no undo operation, thus moving files to the trash can is safer. However, this does not free up any disk space.
- The edbrowse configuration file can contain functions, similar to the .bashrc file in Linux. These functions can invoke other edbrowse commands, along with branching and loops based on the success of these commands. This simple example converts a text file from dos to unix by removing cr (ascii 13) from the end of each line. If any changes were made, the file is written back to disk. The * in the if statement is true if the previous command was successful.
function+undos {
,s/\r$//
if(*) {
w
}
}
User Impressions
Edbrowse is sometimes described as dense in its code and in its human interface. It contains many cryptic one and two letter commands, and few interactive help facilities. There is no menu, no dialog, and no screen of intuitive icons to click on. Like bash, edbrowse greets the user with a blinking cursor, waiting for input, and if that input is syntactically incorrect, edbrowse simply prints a question mark. Thus it is important to read the edbrowse user's guide before diving in.
For those who persevere, edbrowse can become an effective multi-purpose tool that presents one common interface for an assortment of tasks such as editing files, managing directories, receiving email, and surfing the net. William McEwan, of the Puppy Linux forum, describes edbrowse this way.
"The first few days I tried to use this program (based partly on the old UNIX ed) I thought I was in a living nightmare. But then the sun began to shine. Its so easy now, I can literally do it with my eyes closed. Sure, it has its limitations, limited javascript support and so on, but it also comes with much potent magic."
References
External links
- Edbrowse home page, maintained by Chris Brannon
- The command line philosophy, by Karl Dahlke