OOPS, I hit ctrl-enter before I typed in the good news part.
Now the good news:
> > All you have to do is replace "xxx < $configfile" with "sort
> > $configfile | xxx". Actually, you can't since sort is in /usr/bin,
> > you'll have to do a sort with bash functions.
>
> I don't have a sh function available for sorting at the moment and I'm
> not sure whether I can accept the speed loss of such a function.
I just realized you don't need a sort, the entries are numeric from 00 to 99
so you just need something like this
scripts=`grep $runlevel_pattern /etc/runlevel.conf`
for x in 0 1 2 3 4 5 6 7 8 9
do
for y in 0 1 2 3 4 5 6 7 8 9
do
for script in $scripts
do
if [ $script != ${script#S$x$y} ]
then
run $script
fi
done
done
done
Everything is done in the shell so it will be fast. (1.5 seconds for 43
entries in run level 3 with 1 GHz VIA C3-2 processor).
The inner loop could also be changed to start stuff in parallel like the
sysv-rc package is doing except faster since they use disk access to sort.
>
> Tschoeeee
>
> Roland
Cheers,
Tim.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]