h_flip_subfolder.sh 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #! /bin/bash
  2. if [ -z "$1" ]
  3. then
  4. echo "No argument supplied"
  5. echo "Need folder argument"
  6. exit 1
  7. fi
  8. if [ -z "$2" ]
  9. then
  10. echo "No argument supplied"
  11. echo "Need output extension"
  12. exit 1
  13. fi
  14. if [ -z "$3" ]
  15. then
  16. echo "No argument supplied"
  17. echo "Need output folder"
  18. exit 1
  19. fi
  20. main_folder=$1
  21. prefix="p3d_"
  22. build_folder="build"
  23. ext=$2
  24. output_folder=$3
  25. mkdir -p ${output_folder}
  26. for file in $(ls ${main_folder})
  27. do
  28. filename=${main_folder}/${file}
  29. filename_fixed=${filename//\/\//\/}
  30. IFS='.' read -ra ADDR <<< "${file}"
  31. filename_without_ext=${ADDR[0]}
  32. outfile="${filename_without_ext}.${ext}"
  33. echo ${filename_fixed}
  34. echo ${output_folder}/${outfile}
  35. #check if filename contains
  36. # if [[ "$file" == ${prefix}* ]]; then
  37. ./${build_folder}/main/rawls_h_flip --image ${filename_fixed} --outfile ${output_folder}/${outfile}
  38. # fi
  39. done