fix-dir-filenames.sh 386 B

1234567891011121314151617181920212223242526
  1. #! /bin/mksh
  2. usage ()
  3. {
  4. echo "Usage: $(basename "$0") <directory>"
  5. }
  6. if [ "$#" -ne 1 ]
  7. then
  8. echo "Bad number of arguments!"
  9. usage
  10. exit 0
  11. fi
  12. if [ "$1" = "" ]
  13. then
  14. echo "Missing argument!"
  15. usage
  16. exit 0
  17. fi
  18. TARGETDIR="$(realpath "$1")"
  19. FINDEXEC="$(dirname $(realpath "$0"))/.fix-filenames-routine.sh"
  20. #echo "$FINDEXEC"
  21. find "$TARGETDIR" -type f -exec mksh "$FINDEXEC" "{}" \& \;