User Notes presentation

Randy McMurchy randy at linuxfromscratch.org
Sun Apr 9 13:33:19 PDT 2006


M.Canales.es wrote these words on 04/09/06 14:57 CST:

> Not, sorry, not noticed that extra "usernotes" until now.

Okay, then. I'll run the following commands to update almost every
file in the repo. I realize there is redundancy, extra code and
wasted cycles, along with poor scripting below. But it took just
a minute or two and it works. You'll see how I tested, and just
have to change the commented line.

The only thing I did differently is that I didn't use all that
uppercasing in the filename. I didn't think it was necessary or
truly desireable for URL's to be all weird-cased. If it is
determined that the UpperLower type casing is required, it is
just one more grep,awk,cut line to get the UpperLower name.

I'll wait an hour or two to see if anyone sees a glaring mistake.
If I don't hear anything, or someone confirms it looks good, I'll
let it rip and commit.

=========================================================

#!/bin/sh

rm /home/randy/specialadd?.list

find /home/randy/BLFS/BOOK -name "*.xml" >/home/randy/specialadd1.list
echo "Found $(cat /home/randy/specialadd1.list | wc -l) .xml files"
echo

for FILENAME in $(cat /home/randy/specialadd1.list); do
    grep -l '<keyword role="package">' $FILENAME >>/home/randy/specialadd2.list
done
echo "Found $(cat /home/randy/specialadd2.list | wc -l) package .xml files"
echo

for FILENAME in $(cat /home/randy/specialadd2.list); do
    grep -lL 'User Notes:' $FILENAME >>/home/randy/specialadd3.list
done
echo "Found $(cat /home/randy/specialadd3.list | wc -l) package .xml files to modify"
echo

#for FILENAME in $(cat /home/randy/specialadd3.list); do
for FILENAME in /home/randy/BLFS/BOOK/x/lib/goffice.xml; do
    sed -i "1,/<\/sect2>/ s|.*</sect2>|    <para condition=\"html\" role=\"usernotes\">User Notes:\\
    <ulink url=\"\&blfs-wiki;/`basename $FILENAME .xml`\"/></para>\\
\\
&|" $FILENAME
done

-- 
Randy

rmlscsi: [bogomips 1003.28] [GNU ld version 2.16.1] [gcc (GCC) 4.0.3]
[GNU C Library stable release version 2.3.6] [Linux 2.6.14.3 i686]
15:25:00 up 15 days, 3:02, 1 user, load average: 0.00, 0.00, 0.01



More information about the blfs-dev mailing list