#!/bin/bash -x # # moves folder and verifies for symlink before moving - if no symlink, no move, and throw error movemenowyo(){ if [ ! -h "../torrent/$1" ]; then echo "file does not exist: $1" else echo rm "../torrent/$1" echo mv "$1" "../torrent" fi } COUNT=0 for i in `find . -maxdepth 1 -type d`; do #find all directories in current folder if [ $COUNT -lt 100 ]; then movemenowyo "$i" "$COUNT" ((COUNT++)) else echo -n "!" fi done