Skip to main content
deleted 1 character in body
Source Link

Simple as:

cnt= `lscnt=`ls \*.txt 2>/dev/null | wc -l`
if [ "$cnt" != "0" ]; then ./script fi

wc -l counts the lines in the expanded wildcard.

Simple as:

cnt= `ls \*.txt 2>/dev/null | wc -l`
if [ "$cnt" != "0" ]; then ./script fi

wc -l counts the lines in the expanded wildcard.

Simple as:

cnt=`ls \*.txt 2>/dev/null | wc -l`
if [ "$cnt" != "0" ]; then ./script fi

wc -l counts the lines in the expanded wildcard.

suppress warning
Source Link

Simple as:

cnt= `ls \*.txt 2>/dev/null | wc -l`
if [ "$cnt" != "0" ]; then ./script fi

wc -l counts the lines in the expanded wildcard.

Simple as:

cnt= `ls \*.txt | wc -l`
if [ "$cnt" != "0" ]; then ./script fi

wc -l counts the lines in the expanded wildcard.

Simple as:

cnt= `ls \*.txt 2>/dev/null | wc -l`
if [ "$cnt" != "0" ]; then ./script fi

wc -l counts the lines in the expanded wildcard.

correced the if statment
Source Link

Simple as:

cnt= `ls \*.txt | wc -l`
if [ cnt"$cnt" != "0" ]; then ./script fi

wc -l counts the lines in the expanded wildcard.

Simple as:

cnt= `ls \*.txt | wc -l`
if [ cnt ]; then ./script fi

wc counts the lines in the expanded wildcard.

Simple as:

cnt= `ls \*.txt | wc -l`
if [ "$cnt" != "0" ]; then ./script fi

wc -l counts the lines in the expanded wildcard.

formatting
Source Link
Anthon
  • 81.4k
  • 42
  • 174
  • 228
Loading
improved formatting
Source Link
Loading
Source Link
Loading