« Return to Thread: More nits re 3.1.1b2

Re: More nits re 3.1.1b2

by Gordon Bos :: Rate this Message:

Reply to Author | View in Thread

I think you just need quotes around the first grep argument.

I'd replace the grep part with this though:

   cut -d'#' -f1 /etc/modules | \
   grep -v '^[[:space:]]*$' | \
   while read module args
   ....

Gordon

groups, freeman wrote:

> - Problem parsing /etc/modules
> There's a new routine (compared to BuC3.0b2) for parsing the
> /etc/modules file, that unfortunately breaks the reading of the modules
> file if the user has employed any leading tabs or spaces before the name
> of the module (indenting). The part of /etc/init.d/modutils that doesn't
> work for me is this:
>> grep ^[a-z0-9A-Z] /etc/modules |
>> while read module args
>> do
>>      insmod $module $args 2>/dev/null
>>      lsmod | grep -n -q ^$module || \
>>      logger modutils module $module could not be loaded
>> done
> which I replaced with
>> while read module args; do
>>       # Only insmod lines without leading # marks      
>>       if [ "${module:0:1}" != "#" ]; then
>>             insmod $module $args 2>/dev/null
>>             lsmod | grep -n -q ^$module || \
>>             logger modutils module $module could not be loaded
>>       fi
>> done < /etc/modules


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
------------------------------------------------------------------------
leaf-user mailing list: leaf-user@...
https://lists.sourceforge.net/lists/listinfo/leaf-user
Support Request -- http://leaf-project.org/

 « Return to Thread: More nits re 3.1.1b2