]>
Commit | Line | Data |
---|---|---|
e246ba5f | 1 | #!/bin/sh -f |
2bd0ea18 | 2 | # |
e246ba5f | 3 | # Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved. |
dfc130f3 | 4 | # |
2bd0ea18 | 5 | |
e246ba5f NS |
6 | OPTS="" |
7 | VERSION=false | |
8 | USAGE="Usage: xfs_bmap [-adlpvV] [-n nx] file..." | |
e36dcc6f | 9 | DIRNAME=`dirname $0` |
2bd0ea18 | 10 | |
e246ba5f NS |
11 | while getopts "adln:pvV" c |
12 | do | |
13 | case $c in | |
14 | a) OPTS=$OPTS" -a";; | |
15 | d) OPTS=$OPTS" -d";; | |
16 | l) OPTS=$OPTS" -l";; | |
17 | n) OPTS=$OPTS" '-n "$OPTARG"'";; | |
18 | p) OPTS=$OPTS" -p";; | |
19 | v) OPTS=$OPTS" -v";; | |
20 | V) VERSION=true;; | |
21 | \?) echo $USAGE 1>&2 | |
22 | exit 2 | |
23 | ;; | |
24 | esac | |
25 | done | |
e36dcc6f | 26 | $VERSION && $DIRNAME/xfs_io -p xfs_bmap -V |
2bd0ea18 | 27 | |
989b74bc | 28 | shift `expr $OPTIND - 1` |
2bd0ea18 | 29 | |
e246ba5f NS |
30 | while [ "$1" != "" ] |
31 | do | |
989b74bc | 32 | $DIRNAME/xfs_io -r -p xfs_bmap -c "bmap $OPTS" "$1" |
e246ba5f NS |
33 | status=$? |
34 | [ $status -ne 0 ] && exit $status | |
e36dcc6f | 35 | shift |
e246ba5f NS |
36 | done |
37 | exit 0 |