Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Aug 2001 10:36:44 +1000
From:      Greg Black <gjb@gbch.net>
To:        Leo Bicknell <bicknell@ufp.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Should URL's be pervasive. 
Message-ID:  <nospam-999218204.57695@maxim.gbch.net>
In-Reply-To: <20010830111018.A97057@ussenterprise.ufp.org>  of Thu, 30 Aug 2001 11:10:18 -0400
References:  <20010830111018.A97057@ussenterprise.ufp.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Leo Bicknell wrote:

| I ran into a pair of all too common annoyances this morning that
| got me thinking.  Via the magic of cut and paste I ended up with
| the following two sorts of command lines:
| 
| mutt mailto:bicknell@ufp.org
| traceroute http://www.ufp.org/
|
| These of course come from the 'copy link location' available in
| most browsers.  When pasted into most Unix commands (with the
| exception of fetch and lynx, of course) the result is something
| that just doesn't work.  This got me thinking, should all commands
| know how to take an URL, and 'do the right thing'?  Could this
| be made easy by providing a standard URL parsing library that
| all commands could use for parsing?

Why not do it the Unix way?  Create a new application, e.g.,
url(1), to parse the URLs and use it like so:

mutt `url mailto:bicknell@ufp.org`
  --> mutt bicknell@ufp.org
traceroute `url -h http://www.ufp.org/`
  --> traceroute www.ufp.org

With no options, url would provide a "sane" default for the type
of URL, e.g., "user@host.dom" for a mailto.  Options then modify
that; e.g., -u could extract the user part from a mailto; -h
would give the host part of any URL; and so on.

An alternate approach might be to have url exec the command once
it had done its parsing:

url mailto:bicknell@ufp.org mutt
url -h http://www.ufp.org/ traceroute

This way, we don't have to modify all those applications.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?nospam-999218204.57695>