[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#214555: apache-common: error in modules-config preventing configuration



On Tue, Oct 07, 2003 at 01:35:45PM +0100, Matthew Wilcox wrote:
> On Tue, Oct 07, 2003 at 10:07:13PM +1000, Chris Dunlop wrote:
> > The calculation of the $LAST and $DIFF variables is like:
> > 
> >   LAST=`wc -l $TMP | cut -d " " -f1
> >   DIFF=`expr $LAST - $FIRST`
> > 
> > However the output of the cut command has leading spaces,
> > which means $LAST ends up being blank and the expr in the
> > $DIFF calculation fails.
> > 
> > There many, many, many ways of extracting the number of lines,
> > this one works for me:
> > 
> >   LAST=`cat $TMP | wc -l`
> >   DIFF=`expr $LAST - $FIRST`
> 
> Gratuitous use of cat ...
> 
> $ TMP=/etc/apache/httpd.conf 
> $ LAST=`wc -l <$TMP`
> $ echo $LAST
> 1020

Yup, that's much cleaner and will work with either version of
"wc".



Reply to: