[cygwin] 简单的文件移动归整shell脚本

# "df -h" to get the correct path

PATH=/cygdrive/e/download/20180322

DESTDIR=/cygdrive/e/download/collect

/usr/bin/mkdir.exe -p $DESTDIR

#cnt=0
for dirname in `/usr/bin/ls.exe $PATH`
do
  echo "---Dir:" ${dirname}

  for filename in `/usr/bin/ls.exe $PATH/$dirname`
  do
    echo "---------Filename:"${filename}
    NEWFILENAME=${dirname}_${filename}
    echo "---------NewFilename:"${NEWFILENAME}
    /usr/bin/mv.exe ${PATH}/${dirname}/${filename} ${DESTDIR}/${NEWFILENAME}
  done
  
  # Not space when cal the new value to variable cnt
  #cnt=`/usr/bin/expr.exe ${cnt} + 1`
  #if [ ${cnt} -eq 10 ];
  #then
  #  break
  #fi
done