[GTALUG] odd evince command behaviour

Lennart Sorensen lsorense at csclub.uwaterloo.ca
Fri Jan 8 15:40:21 EST 2021


On Fri, Jan 08, 2021 at 11:55:38AM -0500, D. Hugh Redelmeier via talk wrote:
> | From: Lennart Sorensen via talk <talk at gtalug.org>
> 
> | : is special in filenames if it is before the first directory separator
> | for many programs
> 
> That's not UNIX, that's MS-DOS.

I said for many programs, not for unix in general.

> In UNIX, special interpretation is done by the shell.
> 
> | since it might be host:filepath
> 
> The ssh family of commands introduced this, and for that it is
> documented in those commands.
> 
> | evince for example allows ftp://host/file so it clearly cares about :
> | in the filename before any slash.
> 
> Now that I look, it is partially documented in evince(1).
> 
> It says that the operand is a filename.  But in the description of a
> filename, it includes a remote filename.  It doesn't say what that is,
> except to give an FTP example "ftp://adobe.com/sample.pdf".

Well it's man page is about typical for a gnu project.  Almost useless. :)

Unfortunately it doesn't have an info document and the online docs are
not much better.

> I infer: it can be a filename or a URL.  It is assumed to be a URL if
> it starts with letters and then a colon.  If something happens to be a
> filename that matches that pattern, tough luck.

Yeah that seems to be the state of it.  No fall back to plain filename
if it fails to be a known http or ftp protocol.  Maybe they figure
that since you can't use : in a filename on windows, no one would do
it anywhere.

> Since, in practice, URLs seem to always contain "/", and filenames do
> not, that would be a better way to distinguish them.

somewhere/myfile.txt sure looks like it has a / in it.

> | That's why using ./ in front works.  Otherwise you have to escape the :
> | with a \ or perhaps even two of them depending who strips it.
> 
> No, \ does not work for that purpose (my experiments are in this
> thread).

Maybe \\ so the shell can steal one and evince get the other?  Hmm,
nope tried and doesn't work.

./ on the other hand does seem to work.

-- 
Len Sorensen


More information about the talk mailing list