isfat 457 B

12345678910111213141516171819202122
  1. #!/bin/rc
  2. rfork e
  3. # 0000000 eb 3c 90 P l a n 9 . 0 0 00 02 04 02 00
  4. # 0000010 02 00 02 02 P f8 14 00 ? 00 ff 00 ~ 04 } 00
  5. # 0000020 02 P 00 00 80 00 ) a8 04 } 00 C Y L I N
  6. # 0000030 D R I C A L F A T 1 6 fa 8c
  7. if(! ~ $#* 1) {
  8. echo 'usage: isfat /dev/sdC0/part' >[1=2]
  9. exit usage
  10. }
  11. arg=$1
  12. fn fat {
  13. cmp -s <{dd -if $arg -bs 1 -count 3 -skip $1 >[2]/dev/null} <{echo -n FAT}
  14. }
  15. fat 54 || fat 82
  16. exit $status