dummy_cal.sh 332 B

12345678910111213141516171819
  1. #!/bin/bash
  2. echo -e "\e[97mDummy file builder / calculator :\e[0m\e[24m"
  3. function help_ {
  4. echo -e "\nUsage $0 image_size bios_size\n"
  5. }
  6. if [ -x $1 ] |[ -x $2 ]
  7. then
  8. help_
  9. exit 0
  10. fi
  11. result=$[$1-$2]
  12. echo -e "Dummy image size : $result B"
  13. dd if=/dev/zero of=dummy.bin bs=$result count=1 status=none
  14. echo "dummy.bin was generated"