Comment 3 for bug 893271

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 893271] Re: /etc/acpi/screenblank.sh shows awk syntax error

On Mon, Nov 21, 2011 at 08:11:33PM -0000, Brad Evans wrote:
> I found the problem in the script ..

> /usr/share/acpi-support/power-funcs

> I think that in line 9 ..

> user=$(who | awk "/:$displaynum)/ { print \$1; exit }")

> .. should be ...

> user=$(who | awk "/:$displaynum/ { print \$1; exit }")

No, the ) is intentionally part of the match, to preclude accidentally
matching display names that have the one we're looking for as a prefix.

The problem here is gawk and mawk having two different means of interpreting
), and awk being an alternative that could point at either one. mawk is
installed by default, but it's likely that mawk's behavior here is actually
a bug and we probably don't want to rely on it; nor do we want acpi-support
to have to depend on gawk.

So I think the proper solution is to follow up on mawk's behavior and fix
mawk if necessary.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>