Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.42 KB | None | 0 0
  1. findFiles()
  2. {
  3.     echo $1
  4.     for object in "$1"/*
  5.     do
  6.         if test -f "$object"
  7.         then
  8.             echo -n "       ${object##*/}   "
  9.             echo `stat -c%b $object`
  10.             fi
  11.     done
  12.     for object in "$1"/*
  13.     do
  14.         if test -d $object
  15.         then
  16.             findFiles $object
  17.         fi
  18.     done
  19. }
  20.  
  21. if [ $# -eq 1 ]
  22. then
  23.     if test -d $1
  24.     then
  25.         findFiles $1
  26.     else echo "There is no directory with this name"
  27.     fi
  28. else echo "Args count must be equal to 1"
  29. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement