While trying to make a conditional statement to check the amount of files in a directory, I have stumbled upon a problem.
My initial way of writing this script:
ELEM=`ls -l $DIR | wc -l`
if [ $ELEM -lt 5 ] ; then
Which works. However I want to move my $ELEM into the conditional parameter block so it can be interpreted when I reach that if statement. I have tried playing around with different combinations of single quotes, double quotes, back ticks, and parenthese. Does anyone know how to solve this problem?