projects
/
cmccabe-bin
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
4853520
)
mbr_dump.sh: should check script arguments better
author
Colin Patrick McCabe
<cmccabe@alumni.cmu.edu>
Thu, 13 May 2010 03:54:49 +0000 (20:54 -0700)
committer
Colin Patrick McCabe
<cmccabe@alumni.cmu.edu>
Thu, 13 May 2010 03:54:49 +0000 (20:54 -0700)
mbr_dump.sh
patch
|
blob
|
history
diff --git
a/mbr_dump.sh
b/mbr_dump.sh
index
dce7962
..
d97e450
100755
(executable)
--- a/
mbr_dump.sh
+++ b/
mbr_dump.sh
@@
-6,14
+6,22
@@
#
# Colin McCabe
#
+usage() {
+ echo "usage: ${0} <IBM-master-boot-record>"
+ echo "should be 512 bytes in length."
+ exit 1
+}
+
+if [ $# -ne 1 ]; then
+ usage
+fi
if [ -e ${1} ]; then
PART_FILE=${1}
else
- echo "usage: ${0} <IBM-master-boot-record>"
- echo "should be 512 bytes in length."
- exit 1
+ usage
fi
+
echo "# first partition"
od -j 446 -N 16 -t x1 ${1}
echo "# second partition"