[openbox] problems with tilde characters in commands

Anthony Thyssen A.Thyssen at griffith.edu.au
Mon Apr 6 22:05:20 EDT 2009


On Tue, 7 Apr 2009 01:24:26 +0200 (CEST)
Mikael Magnusson <lists at bak.och.fr.am> wrote:


| > In other words, not only are tilde's expanded when they shouldn't be
| > (in the middle of a quoted argument) but openbox does not follow
| > normal XML syntax rules either!
| 
| I think you will find that if you actually use valid XML, it will work 
| just fine. Openbox will still replace the tilde with your homedir though, 
| since that takes place after the XML parsing.
| 
| --
| Mikael Magnusson
| 
| PS &#x7E;
| &tilde; is not a predefined xml reference, quoth wikipedia:
| 
| Special characters can be represented either using entity references, or 
| by means of numeric character references. An example of a numeric 
| character reference is "&#x20AC;", which refers to the Euro symbol by 
| means of its Unicode codepoint in hexadecimal.
| 
| An entity reference is a placeholder that represents that entity. It 
| consists of the entity's name preceded by an ampersand ("&") and followed 
| by a semicolon (";"). XML has five predeclared entities:
| 
|      * &amp; (& or "ampersand")
|      * &lt; (< or "less than")
|      * &gt; (> or "greater than")
|      * &apos; (' or "apostrophe")
|      * &quot; (" or "quotation mark")
| 
using    &#x7E;   parses correctly,  Thanks.

But as you say the tilde is added by the XML parse BEFORE "openbox"
does the tilde expansion.  As such...

   xte 'usleep 500000' 'str http://www.cit.gu.edu.au/&#x7E;anthony/'

also produces the incorrect output of

  http://www.cit.gu.edu.au//home/anthonyanthony/

As such the only working solution thus far is the very horrible
work around of.

    bash -c "xte 'usleep 500000' \\\
        'str http://www.cit.gu.edu.au/'`printf '\176'`'anthony/'

The tilde is thus provided by the command line "printf" AFTER
openbox has executed it.

And yes  three backslashes are now needed due to quoting requirements,
even though only one is needed from the command line.  Could this be
another "openbox" parsing problem?

The question then comes down to: How fast can we get 'tilde expansion'
fixed in the "openbox" source?

That is only do the expansion if not in quotes, and precessed by the
start of the line, or white space.



  Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
 -----------------------------------------------------------------------------
   The gods confound the man who first found out how to distinguish hours!
   Confound him, too, who in this place set up a sun-dial, to cut and hack
   my days so wretchedly into small portions.             -- Titus Plautus
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/


More information about the openbox mailing list