[Pkg-sysvinit-devel] Bug#734901: Bug#734901: initscripts: More Proper Detection of "fastboot" Kernel Parameter necessary

Sebastian Steinhuber sebastian.steinhuber at googlemail.com
Mon Jan 13 16:38:33 UTC 2014


Am 13.01.2014 01:15, schrieb Henrique de Moraes Holschuh:
> severity 734901 grave
> found 734901 sysvinit/2.88dsf-13
> notfound 734901 sysvinit/2.88dsf-45
> thanks
[...]Ack.
>
> All other uses of "grep -w" to check the kernel command line are likewise
> buggy, and could use some pro-active fixing.  Another collision is just a
> matter of time...

Hmm, besides of this, I'm not a developer, I'm a user/admin; I feel that 
suggesting a new, more restrictive filter to grep for 'words' only 
containing [A-Za-z0-9_], i.e. containing the POSIX character classes 
"[[:alpha:]_]" and beginning/ending with either space, tab, newline or 
null (from my humble understanding), would not be too bad anyway in 
simplifying shell scripting dramatically. Right?

Regarding this excerpt from man grep:
>       -w, --word-regexp
>               Select  only  those  lines  containing  matches  that form whole
>               words.  The test is that the matching substring must  either  be
>               at  the  beginning  of  the  line,  or  preceded  by  a non-word
>               constituent character.  Similarly, it must be either at the  end
>               of  the  line  or  followed by a non-word constituent character.
>               Word-constituent  characters  are  letters,  digits,   and   the
>               underscore.

In fact "grep -w word-regexp" should do exactly that: [=.] are neither 
letters, digits, nor underscore. period ;-)
I remember that this (-w dysfunction) is biting me since years and I 
then was asking me why all those scripting ninjas out there don't 
complain. I will file a bug against grep later.

In this case:
% grep -s -i -e '\w fastboot' /proc/cmdline

should behave as
% grep -s -w -i "fastboot" /proc/cmdline
in my understanding. No?

FYI, actually
% grep -s -i -e '\w fastboot' /proc/cmdline
does what we expect (only quickly checked)! :-)
Thanks.


	Sebastian



More information about the Pkg-sysvinit-devel mailing list