livecdfs-update.sh: Escape ampersands in STARTX sed expression
authorW. Trevor King <wking@tremily.us>
Sun, 3 Mar 2013 16:53:18 +0000 (11:53 -0500)
committerBrian Dolbec <dolsen@gentoo.org>
Wed, 29 May 2013 03:39:57 +0000 (20:39 -0700)
commit516e9108941e4b8992d7379aef1095139d476b33
tree1d35bf19fe20751c4bff9d11802e1ef212dec06d
parent55ff8fb453139ac4ae12f52309ef3696440f3f70
livecdfs-update.sh: Escape ampersands in STARTX sed expression

From sed(1):

  s/regexp/replacement/
    Attempt to match regexp against the pattern space.  If successful,
    replace that portion matched with replacement.  The replacement
    may contain the special character & to refer to that portion of
    the pattern space which matched, and the special escapes \1
    through \9 to refer to the corresponding matching sub-expressions
    in the regexp.

This means that the old expression (with unescaped ampersands) lead
to:

  source /etc/profile ##STARTX##STARTX su - ${first_user} -c startx

when we want:

  source /etc/profile && su - ${first_user} -c startx

with ${first_user} expanded in both cases.

Reviewed-by: Matt Turner <mattst88@gmail.com>
targets/support/livecdfs-update.sh