I'm trying to pull out the third subexpression from this line:
#EXTRA_GROUPS="dialout cdrom floppy audio video plugdev users"
adduser.conf file, for those of you who are curious) with:
sed 's/\(EXTRA_GROUPS=\)\("\)\(.*\)\("\)/\3/' adduser.conf
While this does work and produces
#dialout cdrom floppy audio video plugdev users
(I've left the
# symbol out of the expression, so please disregard), this
sed 's/\(EXTRA_GROUPS=\)\("\)\(.*\)\("\)//3' adduser.conf
doesn't and leaves the file as is.
I do realize that the last example is supposed to delete back reference number three, but when I modify the command with
/sd/3 ("replace 3rd subexpression with
sd") it doesn't really do anything, either.
I have tried running the command with the
-n //p options-all to the same result.
I'm using GNU
sed version 4.2.2 on a Debian Jessie box.
Have I missed some crucial part of my core utilities "education" or is it that I haven't been out in the sun for while?