[GTALUG] odd evince command behaviour

D. Hugh Redelmeier hugh at mimosa.com
Thu Jan 7 15:04:30 EST 2021


| From: Dhaval Giani via talk <talk at gtalug.org>

| On Thu, Jan 7, 2021 at 11:32 AM D. Hugh Redelmeier via talk <talk at gtalug.org> wrote:

| > Also:
| >         evince 'RE\: something.pdf'
| > fails because evince tries to open a file with \ in its name.
| 
| That is because within the single quotes, it will not use the \ as an
| escape character. I'm unsure of the behaviour within double quotes.

OK, my model is that there are two entities that are doing
quoting/globbing/etc.

1. the shell

2. the application program (evince) itself.

This second is un-UNIX-like behaviour.  But common in other operating
systems.

The single quotes are not seen by 2.  They are interpreted by 1.

But I established that the RE: was being handled (mishandled) by 2.

So I wanted a "quote" function for 2.  I tried \ but 2 did not treat
it as a metacharacter.

There might be a quote function for 2 but I don't know it.

There are applications that make interpretations of filenames but this
often creates problems.

- if a filename looks like a flag argument, applications will try to 
  handle it as a flag argument.  Many applications provide a workaround 
  this with a - flag argument which means "treat the rest of the arguments 
  as filenames, even if they start with -"

- scp interprets hostname:filename as just that.  This means that 'RE: 
  something.pdf" will be a problem for scp.  Solution: prepend with ./

I don't know what evince is trying to do.


More information about the talk mailing list