Created
June 6, 2020 05:45
-
-
Save alvarovm/7996ca37cf8ec7b1e8375f93e84fb514 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g=0 | |
t=0 | |
ff=40000 | |
#ff=5 | |
destiny=output.save.$t | |
mkdir $destiny | |
Loop_array=(`ls -1 output`); | |
Total_loop_num=${#Loop_array[*]}; | |
for((i=0;i<$Total_loop_num;i++)) | |
do | |
echo -ne "Progress: $[ ($i+1)*100/$Total_loop_num ]%\r"; | |
e=${Loop_array[$i]}; | |
#for e in output.save/* | |
# do | |
this=$((g%ff)) | |
name=`basename $e` | |
orig=output/$e | |
if [ 0 == $this ] | |
then | |
t=$((t+1)) | |
destiny=output.save.$t | |
mkdir $destiny | |
echo $destiny | |
fi | |
mv $orig $destiny | |
# echo $destiny/$name | |
if [ -d $destiny/$name ] | |
then | |
g=$((g+1)) | |
else | |
exit 0 | |
fi | |
#done | |
done; | |
echo "Loop finished."; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment