i am a new user and I was trying to build a script with which i can count how many files are in a direcotry, i did this but it does not seem to work.
#! /bin/bash
read -p 'path: ' dir
dir=$dir
if [ "$dir" != "stop" ]
then
exit
fi
while [ -d $dir ]
do
wc=$(( ls $dir | wc -l ))
done
echo $wc