countchars.sh 166 B

12345678
  1. #!/bin/bash
  2. gm identify -format "%W %H" "$1" | while read width height
  3. do
  4. cols=$((width / 8))
  5. rows=$((height / 8))
  6. seq -f "$2" 0 $((cols*rows - 1))
  7. done