dummy_calculator.sh 335 B

12345678910111213141516171819
  1. #!/bin/bash
  2. echo -e "\e[97mDummy file builder / calculator v2.0:\e[0m\e[24m"
  3. function help_ {
  4. echo -e "\nUsage $0 bios_size chip_size\n"
  5. }
  6. if [ -x $1 ] |[ -x $2 ]
  7. then
  8. help_
  9. exit 0
  10. fi
  11. result=$[$2-$1]
  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"