r4182 - in trunk/bootscripts: . lfs/init.d

James Robertson jwrober at linuxfromscratch.org
Wed Sep 22 20:57:04 PDT 2004


Nathan Coulson wrote:
> On Wed, 22 Sep 2004 10:45:43 -0500, James Robertson
> <jwrober at linuxfromscratch.org> wrote:
> 
>>nathan at linuxfromscratch.org wrote:
>>
>>>+
>>>+     # This will limit BOOTMESG to be no longer then what WCOL is set to,
>>>+     # by adding \n's where appropriate.
>>>+     BOOTMESG=`echo ${BOOTMESG} | sed -n -e "s/\\\\n/\n/g;L ${WCOL}"`
>>
>>This won't work Nathan.  The quoting in the sed piece will get messed
>>up.  Use the variable solution in my function file.
> 
> can you elaborate on what will go wrong?  I've been testing it out and
> I am actually quite happy with how it works...
>  

Any \n's passed in inside the string will not get parsed by sed.  The 
whole point of the sed besides to split the string up to less that the 
value of $WCOL is to allow you to pass explicit \n's in the string to 
format paragraphs for error messages.

Send your function a string like this

This is a really long message that is meant to pass the width of the 
screen to see what happens.\n\nI like to see this kind of stuff.

If the sed does it's job right, you should get an empty line between the 
two sentences.  Take a look at checkfs and see how I reformatted the 
error strings and you'll understand what I am trying to provide in the 
fucntion.

I think you are making this hard on yourself, just copy and paste my 
fucntion in and use it.  It can be easily modified to get the other 
things you want to do as well.  I am already working on it.

James



More information about the lfs-book mailing list