Is there a way to count a certain number of files using its extension?
Example: If there is greater than 5 .txt files in the folder, then do something...
Moderator: Mr_Noodle
if (all) of the following conditions are met for (the file or folder being processed):
extension is CSV
passes shell script (embedded script)
...
Do the following to the matched file or folder:
send notification "there are 8 or more files in this folder with the extension " (extension)
MAXCOUNT=8;
filename=$(basename "$1"); extension="${filename##*.}"
if [ "$(ls -1 $(dirname "$1")| grep -cE ".$extension$")" -gt "$MAXCOUNT" ]; then exit 0; else exit 1; fi