-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from yousefvand/dev
Dev
- Loading branch information
Showing
47 changed files
with
2,404 additions
and
616 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Check if a path is provided | ||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <directory-path>" | ||
exit 1 | ||
fi | ||
|
||
# Assign the provided path to a variable | ||
DIR="$1" | ||
|
||
# Check if the provided path is a valid directory | ||
if [ ! -d "$DIR" ]; then | ||
echo "Error: $DIR is not a valid directory." | ||
exit 1 | ||
fi | ||
|
||
# Find files, check MIME type, and count text files | ||
total_text_files=$(find "$DIR" -type f -exec file --mime-type {} + | grep -c "text/") | ||
|
||
# Output the result | ||
echo "Total text files in '$DIR' and its subdirectories: $total_text_files" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.