#A shell executable program to determine the number of files within a folder specified by the user. It tests whether the number of files is less than 10 and prints
# the file names on the original output. If the number is greater than that, it writes the file names within a file in the same folder called numfiles.
#program name : shell.sh
#!/bin/bash
directory=$1# the folder you search for
Number_of_files=0
for file in"$directory"/*;do
if[-f"$file"];then
Number_of_files=$((Number_of_files +1))
fi
done
echo"Number of file in this folder = $Number_of_files"
#A shell executable program to determine the number of files within a folder specified by the user. It tests whether the number of files is less than 10 and prints
# the file names on the original output. If the number is greater than that, it writes the file names within a file in the same folder called numfiles.
#program name : shell.sh
#!/bin/bash
directory=$1# the folder you search for
Number_of_files=0
for file in"$directory"/*;do
if[-f"$file"];then
Number_of_files=$((Number_of_files +1))
fi
done
echo"Number of file in this folder = $Number_of_files"