{
attr $* 2>$tmp.err >$tmp.out
exit=$?
- sed -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g; s#$tmp[^ :]*#<TMPFILE>#g;"\
+ sed \
+ -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g" \
+ -e "s#$tmp[^ :]*#<TMPFILE>#g;" \
$tmp.out
- sed -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g; s#$tmp[^ :]*#<TMPFILE>#g;"\
+ sed \
+ -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g" \
+ -e "s#$tmp[^ :]*#<TMPFILE>#g;" \
$tmp.err 1>&2
return $exit
}
{
getfattr $* 2>$tmp.err >$tmp.out
exit=$?
- sed -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g; s#$tmp[^ :]*#<TMPFILE>#g;"\
+ sed \
+ -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g" \
+ -e "s#$tmp[^ :]*#<TMPFILE>#g;" \
$tmp.out
- sed -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g; s#$tmp[^ :]*#<TMPFILE>#g;"\
+ sed \
+ -e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g" \
+ -e "s#$tmp[^ :]*#<TMPFILE>#g;" \
$tmp.err 1>&2
return $exit
}
echo "*** mkfs"
mkfs_xfs $SCRATCH_DEV >/dev/null \
|| _fail "mkfs failed"
-
+
echo "*** mount FS"
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >/dev/null \
|| _fail "mount failed"
-
+
testfile=$SCRATCH_MNT/testfile
echo "*** make test file 1"
_getfattr --absolute-names $testfile.2
# print name and size from 1st line of output
-_attr -g "a3" $testfile.2 | head -1
+_attr -g "a3" $testfile.2 > $tmp.hahahahaplonk
+head -1 $tmp.hahahahaplonk
+# NOTE:
+# Above goo works around some truly bizzaro sh/sed/head interaction
+# for some versions of these tools (fails on Redhat 7+, 6.2 worked)
# print out the rest of the data apart from the header
# the size is +1 for an extra \n at the end