Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- search() {
- for name in "$1"/*; do
- if [ $filter_flag -eq 1 ] && printf "$name" | grep -qE "^.*\/(.*$filter\w{0,})$"; then
- : # if filter was enabled, ignore dirs and files
- else
- # if file was found, save it's size to array
- if [ -f "$name" ]; then
- file_count=$(($file_count + 1))
- write_f_size "$name"
- # if dir was found, call search function (recursivly)
- elif [ -d "$name" ]; then
- dir_count=$(($dir_count + 1))
- search "$name";
- fi
- fi
- done
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement