urlview - URL extractor/launcher
urlview <filename> [ <filename> ... ]
urlview is a screen oriented program for extracting URLs from text files and displaying a menu from which you may launch a command to view a specific item.
urlview attempts to read ~/.urlview upon startup. If this file doesn't exist, it will try to read a system wide file in /etc/urlview/system.urlview. There are two configuration commands (order does not matter):
REGEXP <regular expression to use for URL matching>
urlview uses a regular expression to extract URLs from the specified text files. \r, \t, \n and \f are all converted to their normal printf(2) meanings. The default REGEXP is
(((http|https|ftp|gopher)|mailto):(//)?[^ <>"\t]*|(www|ftp)[0-9]?\.[-a-z0-9.]+)[^ .,;\t\n\r<">\):]?[^, <>"\t]*[^ .,;\t\n\r<">\):]
COMMAND <command to launch with URL>
If the specified command contains a ``%s'', it will be subsituted with the URL that was requested, otherwise the URL is appended to the COMMAND string. The default COMMAND is
url_handler.sh '%s'another possibility would be
Netscape -remote 'openURL(%s)'NOTE: you should always put single quotes ('') around usage of ``%s'' and never let the REGEXP to match any string containing a single quote (note
[⁁'...]
in the default REGEXP)
to avoid characters in the selected URL from being interpreted
by your shell. For example, I could put the following URL in my email
messages:
X-Nasty-Url: http://www.`program_to_execute_as_you`.comIf you pass this URL to your shell, it could have nasty consequences.
system-wide urlview configuration file
urlview configuration file
If the environment variable BROWSER is set to a browser command, or a colon-delimited list of commands to try, then the specified browser is used. %s is replaced with the quoted url to view. If %s is not part of a command, the url is appended to the command.
The BROWSER environment variable is honored only if the rc-file doesn't contain the COMMAND option. The rc-file provided by the Debian package contains a COMMAND option.
regcomp(3)
Michael Elkins <me@cs.hmc.edu>. Modified for Debian by Luis Francisco Gonzalez <luisgh@debian.org> and Emanuele Rocca <ema@debian.org>. Modified for SuSE by Dr. Werner Fink <werner@suse.de> and Stepan Kasal <kasal@suse.cz>.