numfiles.sh 418 B

123456789101112131415
  1. #!/usr/bin/env bash
  2. # Name: D.Saravanan
  3. # Date: 30/07/2021
  4. # Script to find number of files in the present working directory
  5. number_of_files="$(find . * | wc -l)"
  6. if [[ "$number_of_files" -gt 100 ]]; then
  7. echo "More than 100 files in the working directory!"
  8. elif [[ "$number_of_files" -gt 10 ]]; then
  9. echo "More than 10 files in the working directory!"
  10. else
  11. echo "Ten or fewer files in the working directory."
  12. fi