]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - io/xfs_bmap.sh
configure: remove unecessary definitions of _FILE_OFFSET_BITS
[thirdparty/xfsprogs-dev.git] / io / xfs_bmap.sh
1 #!/bin/sh -f
2 #
3 # Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved.
4 #
5
6 OPTS=""
7 VERSION=false
8 USAGE="Usage: xfs_bmap [-adlpvV] [-n nx] file..."
9 DIRNAME=`dirname $0`
10
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
26 $VERSION && $DIRNAME/xfs_io -p xfs_bmap -V
27
28 shift `expr $OPTIND - 1`
29
30 while [ "$1" != "" ]
31 do
32 $DIRNAME/xfs_io -r -p xfs_bmap -c "bmap $OPTS" "$1"
33 status=$?
34 [ $status -ne 0 ] && exit $status
35 shift
36 done
37 exit 0