'''Edbrowse''' is a combination of [[text editor]], [[web browser]], and [[email client]] that runs in [[Command-line interface|command-line mode]]. It is a [[headless browser]] and does not display files or web pages in two dimensions across the screen; instead it accepts commands and prints responses, much like the [[Unix shell|shell]]. Edbrowse was modeled after [[ed (text editor)|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 [[Blindness|blind]] users, but many sighted users have taken advantage of its [[Scripting language|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. It can also tap into [[database]]s through [[Open Database Connectivity|ODBC]]. A traditional substitute command updates the corresponding row in an [[SQL]] table, and similarly for insert and delete. Edbrowse is licensed under the [[GNU General Public License|GPL]] and included in several [[Linux distribution]]s<ref>[https://packages.debian.org/search?keywords=edbrowse ''Edbrowse'' distributed by Debian]</ref><ref>[https://aur.archlinux.org/packages/edbrowse-git ''Edbrowse'' on arch linux]</ref><ref>[https://packages.ubuntu.com/bionic/edbrowse ''Edbrowse'' on Ubuntu 18]</ref>, [[free BSD|FreeBSD]].<ref>[https://www.freebsd.org/cgi/ports.cgi?query=edbrowse&stype=all ''Edbrowse'' on FreeBSD]</ref> and [[MacPorts|MacPorts]]<ref>[https://www.macports.org/ports.php?by=name&substr=edbrowse ''Edbrowse'' package listed in MacPorts]</ref>

== Command-line philosophy ==
Edbrowse is part of a larger philosophy, wherein editors, browsers, mail clients, spreadsheets, and other critical [[computer application|applications]] are rewritten from the ground up if necessary to support various [[disability|disabilities]]. This stands in contrast to the [[Front and back ends|front end]] approach, which modifies or enhances the input/output layer and leaves the applications alone. [[Internet Explorer|Explorer]], [[Microsoft Outlook|Outlook]], and [[Microsoft Word|Word]] all run without modification, while a [[screen reader]] such as [[Window-Eyes]] converts the words or [[computer icon|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 [[Browser plugin|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|Microsoft 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 scripting|client side javascript]] was impractical, so in 2008 Dahlke wrote version 3, which incorporates the open source [[SpiderMonkey (JavaScript engine)|SpiderMonkey]] JavaScript engine. 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, copy, and paste]]. For instance, <code>edbrowse *.c</code> accesses all the C sourcefiles in the current directory.
* The regular expressions of ed have been replaced with [[Perl Compatible Regular Expression]], 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 [[Hypertext Transfer Protocol|HTTP]], [[HTTPS]] or [[File Transfer Protocol|FTP]]. Once the page is fetched into the active buffer, it can be browsed or rendered as text, using the <code>b</code> command. This supplements the other one-letter commands which were already part of ed. Once the page is browsed, the user can go to [[hyperlink]]s or fill out and submit [[Form (HTML)|forms]].
* The <code>-fm</code> option turns edbrowse into an interactive email client. It fetches mail from one or more [[Post Office Protocol|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 [[Simple Mail Transfer Protocol|SMTP]]. [[Internet Message Access Protocol|IMAP]] is also supported.
* In database mode, edbrowse can access selected rows and columns of an [[SQL]] table through [[Open Database Connectivity|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 (computing)|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 [[conditional branch|branching]] and [[for loop|loops]] based on the success of these commands. This simple example converts a text file from dos to unix by removing [[newline]] character from the end of each line. If any changes were made, the file is written back to disk. The <code>*</code> in the if statement is true if the previous command was successful.

<syntaxhighlight lang=c>
function+undos {
        ,s/\r$//
        if(*) {
                w
        }
}</syntaxhighlight>

== 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 (Unix shell)|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. Took me two full days, and I'm still learning, but its so easy now. I can literally do it with my eyes closed. It covers so many daily needs: text editing, web-browsing, email, database access, file management, ftp. Sure, it has its limitations, limited javascript support and so on, but it also comes with much potent magic."

== References ==

{{Reflist}}

== External links ==
* [http://edbrowse.org/ Edbrowse home page], maintained by Chris Brannon
* [http://www.eklhad.net/philosophy.html The command line philosophy], by Karl Dahlke

[[Category:Web accessibility]]
[[Category:Free text editors]]
[[Category:Free email software]]
[[Category:Free web browsers]]
[[Category:Linux web browsers]]
[[Category:Text-based web browsers]]
