[openbox] problems with tilde characters in commands
Dana Jansens
danakj at orodu.net
Mon Apr 6 22:58:54 EDT 2009
2009/4/6 Anthony Thyssen <A.Thyssen at griffith.edu.au>:
> 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 ~
> | ˜ 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 "€", 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:
> |
> | * & (& or "ampersand")
> | * < (< or "less than")
> | * > (> or "greater than")
> | * ' (' or "apostrophe")
> | * " (" or "quotation mark")
> |
> using ~ 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/~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?
Such hostility, it's amazing.
> That is only do the expansion if not in quotes, and precessed by the
> start of the line, or white space.
Allowing a quoted \~ which gets passed literally to the command,
instead of being expanded, should be nice.
More information about the openbox
mailing list