Changeset 7929

Show
Ignore:
Timestamp:
02/22/07 15:34:23 (1 year ago)
Author:
dnicholson
Message:

Use POSIX shell built-ins to calculate STRING_LENGTH

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bootscripts/ChangeLog

    r7928 r7929  
     12007-02-22      Dan Nicholson   <dnicholson@linuxfromscratch.org> 
     2        * lfs/init.d/functions: Use arithmetic expansion and string length, 
     3          which are both mandated by POSIX, rather than spawning two processes 
     4          every time boot_mesg() is called. 
     5 
    162007-02-22      Dan Nicholson   <dnicholson@linuxfromscratch.org> 
    27        * lfs/init.d/functions: In order to provide an `echo' which provides 
  • trunk/bootscripts/lfs/init.d/functions

    r7928 r7929  
    111111 
    112112        ## Figure out the length of what is to be printed to be used 
    113         ## for warning messges.  
    114         STRING_LENGTH="`echo "${1}" | sed \ 
    115                 -e 's,.,.,g' -e 'l 1' | grep -c \$`" 
     113        ## for warning messages.  
     114        STRING_LENGTH=$((${#1} + 1)) 
    116115 
    117116        # Print the message to the screen