Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. mkdir $2
  2. cp -R $1/* $2
  3.  
  4. for file in $1/*;do #all files in testInput
  5. if [ -d "$file" ] #if its a file then look at the contents of it
  6. then
  7. for inDir in $file/*; do
  8. if [ -d "$inDir" ]
  9. then
  10. for line in $inDir ; do
  11. if [ line != *.txt ]
  12. then
  13. rm line
  14.  
  15. fi
  16. done
  17. fi
  18. done
  19.  
  20. else
  21. for files in file; do
  22. if [ files != *.txt ]
  23. then
  24. rm files
  25. fi
  26. done
  27.  
  28. fi
  29. done
  30.  
  31. find "$1" -type f ! -name "*.txt" -exec mv {} "$2" ;
  32.  
  33. find "$dir" -type f ! -name "*.txt" -exec rm {} ;
  34.  
  35. if [ line != *.txt ]
  36. # ...
  37. if [ files != *.txt ]
  38.  
  39. [[ $line =~ .txt$ ]] || rm line
  40.  
  41. for files in file; do
  42.  
  43. for files in "$file"/*; do
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement