Skip to Content.
Sympa Menu

sm-grimoire-bugs - [SM-Grimoire-Bugs] [Bug 10439] init.d has a grep that throws an error in init.d/udevd

sm-grimoire-bugs AT lists.ibiblio.org

Subject: SourceMage Grimoire Bug List

List archive

Chronological Thread  
  • From: bugzilla-daemon AT bugs.sourcemage.org
  • To: sm-grimoire-bugs AT lists.ibiblio.org
  • Subject: [SM-Grimoire-Bugs] [Bug 10439] init.d has a grep that throws an error in init.d/udevd
  • Date: 3 Jun 2007 09:58:49 -0000

http://bugs.sourcemage.org/show_bug.cgi?id=10439





------- Additional Comments From sobukus AT sourcemage.org 2007-06-03 04:58
-------
Just wanted to note that I cannot find /bin/awk in FHS, either.
also I can find /bin/grep here... but that's not from the (current) spell,
apparently - perhaps I once just copied it...

Thing is, does awk have more right to be in /bin than grep?
Is there a sane way do do it without any of those?
Well, a replacement without special dependency (like bash3 regex) would be
something old-fashioned like this in C:

#include <string.h>

/*
simple inverse grep replacement for simple strings in simple strings
returns 0 if argument 1 is not found inside argument 2, else -1
*/

int main(int argc, char **argv)
{
int i;
int ret = -1;
if(argc == 3 && (strstr(argv[2], argv[1])) == NULL) ret = 0;

return ret;
}

init.d could install this as /sbin/nogrep or whatever and

grep -vq '/etc/init[.]d' /proc/$i/cmdline

could be replaced by

nogrep /etc/init.d $(cat /proc/$i/cmdline).

At least that would be consequent and would allow awk to go out of /bin, too,
when we want to be strict about FHS there.
Of course there is the question if it's smart to install an additional
program just to not install a program in /bin, but at least it's a really
tiny one...

--
Configure bugmail: http://bugs.sourcemage.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




Archive powered by MHonArc 2.6.24.

Top of Page