Advertisement
Guest User

Linux ballwang

a guest
Feb 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #!/bin/bash
  2.    
  3. echo "What directory do you want to check for files?"
  4.  
  5. read directory
  6.  
  7. mkdir user_records
  8.  
  9. if [ -r $directory]
  10.  
  11. then
  12.  
  13.     curdir=$PWD
  14.     cd $directory  
  15.  
  16.     files=$(ls *.conf 2> /dev/null | wc-w)
  17.  
  18. if [$files !=0]
  19.  
  20. then
  21.  
  22.     ls*.conf
  23. else
  24.     echo "no conf files found"
  25.    
  26. fi
  27.  
  28. files=""
  29.  
  30. cd $curdir
  31.  
  32. curdir=""
  33.  
  34. else
  35.  
  36.     echo"Directory does not exist or is unreadable"
  37.  
  38. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement