Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.40 KB | None | 0 0
  1. !/bin/bash
  2.  
  3. if [ $# -ne 1 ]
  4. then
  5.         echo "Wymagany 1 argument (katalog)"
  6.         exit 1
  7. fi
  8.  
  9. if [ ! -d $1 ]
  10. then
  11.         echo "Podany argument nie jest katalogiem"
  12.         exit 1
  13. fi
  14.  
  15.  
  16. find $1 -type f -printf "%f\n" | awk '
  17. BEGIN {
  18.   licznik = 0
  19. }
  20.  
  21. {
  22.   if( substr($0, length($0)) == substr($0, 0, 1) ){
  23.     licznik = licznik +1
  24.   }
  25. }
  26.  
  27. END {
  28.       print licznik  
  29. }
  30. '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement