Advertisement
nblknn

Zaebalo

Nov 21st, 2024 (edited)
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.29 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ -e $2 ];
  4. then
  5.     OIFS=$IFS
  6.     IFS=$'\n'
  7.  
  8.     for file in $(find $2 -type f);
  9.     do
  10.         if [ -r $file ];
  11.         then
  12.             if grep $1 -q $file;
  13.             then
  14.                 ls -sh $file           
  15.             fi
  16.         else
  17.             echo "Can't open file $file"
  18.         fi
  19.     done
  20.  
  21.     IFS=$OIFS
  22.  
  23. else
  24.     echo "Directory $2 not found"
  25. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement