dirrand


SUBMITTED BY: Guest

DATE: Feb. 23, 2013, 10:36 p.m.

FORMAT: Bash

SIZE: 321 Bytes

HITS: 1680

  1. #!/bin/bash
  2. let FILECOUNT=$RANDOM%`ls | wc -l`;
  3. echo $RANDOM%$FILECOUNT
  4. for i in $(ls); do
  5. if [ $FILECOUNT -gt 1 ]; then
  6. let FILECOUNT-=1;
  7. else
  8. file $i
  9. # echo $i
  10. cd $i
  11. if [ $? -eq 0 ]; then
  12. dirrand;
  13. fi
  14. exit;
  15. fi
  16. done

comments powered by Disqus