[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 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

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk



Reply to: