Hi,
I need to count the lines of a file stack.html and if the amount lines i want to do something.
At this moment, I have
if [ wc -l stack.html -gt 4 ];
then ...
This is not working. Any ideas?
Thanks!
Hi,
I need to count the lines of a file stack.html and if the amount lines i want to do something.
At this moment, I have
if [ wc -l stack.html -gt 4 ];
then ...
This is not working. Any ideas?
Thanks!
linecnt=$( cat myfile.html | wc -l ) # not a UUOC because we want one result
if [ $linecnt - gt 4 ] ; then
# do something
fi
IMHO:
$(wc -l < infile)
perfect, thanks mate