Comment 4 for bug 1969447

Revision history for this message
Jack Howarth (jwhowarth) wrote :

Note that I stumbled onto the above fix after noticing the example shown for the udev escaped quoting support showed an example with double quotes surrounded by single quotes which in turn surrounded escaped double quotes...

https://git.alternativebit.fr/NinjaTrappeur/Systemd/commit/7e760b79ad143b26a5c937afa7666a7c40508f85

udev-rules: all values can contain escaped double quotes now (#6890)
This is primarly useful to support escaped double quotes in PROGRAM or
IMPORT{program} directives.

The only possibilty before this patch was to use an external shell script but
this seems too cumbersome for trivial logics such as

 PROGRAM=="/bin/sh -c 'FOO=\"%s{model}\"; echo ${FOO:0:4}'"

or any similar shell constructs that needs to deals with patterns including
whitespaces.

As it's the case for single quote and for directives running a program, words
within escaped double quotes will be considered as a single argument.

Fixes: #6835