Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- todir=$1
- cd $( dirname $0 )
- DIRLIST=$( ls -F | grep '/' | tr -d '/' )
- for DIR in $DIRLIST
- do
- mp3num=$( ls $DIR | grep -c \\.mp3 )
- m4anum=$( ls $DIR | grep -c \\.m4a )
- filnum=$( ls $DIR | wc -l )
- echo $DIR $mp3num $mp4num $filnum
- if [ $DIR = $todir ]; then
- continue
- fi
- if [ $m4anum = 0 -o $mp3num = 0 ]
- then
- continue
- elif [ $mp3num != 0 -a $m4anum != 0 ]
- then
- mv $DIR/*.mp3 $todir
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement