Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mkdir $2
- cp -R $1/* $2
- for file in $1/*;do #all files in testInput
- if [ -d "$file" ] #if its a file then look at the contents of it
- then
- for inDir in $file/*; do
- if [ -d "$inDir" ]
- then
- for line in $inDir ; do
- if [ line != *.txt ]
- then
- rm line
- fi
- done
- fi
- done
- else
- for files in file; do
- if [ files != *.txt ]
- then
- rm files
- fi
- done
- fi
- done
- find "$1" -type f ! -name "*.txt" -exec mv {} "$2" ;
- find "$dir" -type f ! -name "*.txt" -exec rm {} ;
- if [ line != *.txt ]
- # ...
- if [ files != *.txt ]
- [[ $line =~ .txt$ ]] || rm line
- for files in file; do
- for files in "$file"/*; do
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement