ZTS: Use wc -c instead of --bytes for portability

FreeBSD does not have the long opts for wc.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #9963
This commit is contained in:
Ryan Moeller 2020-02-07 15:31:38 -05:00 committed by GitHub
parent 795699a6cc
commit 9825e7ad1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ log_must zfs snapshot $clone@snap
log_must zfs redact $sendfs@snap book $clone@snap
log_must eval "zfs send -nvP --redact book $sendfs@snap | \
grep '^size' | awk '{print \$2}' >$size"
log_must eval "zfs send --redact book $sendfs@snap | wc --bytes \
log_must eval "zfs send --redact book $sendfs@snap | wc -c \
>$size2"
bytes1=$(cat $size | tr -d '[[:space:]]')
bytes2=$(cat $size2 | tr -d '[[:space:]]')
@ -55,7 +55,7 @@ bytes2=$(cat $size2 | tr -d '[[:space:]]')
log_must zfs snapshot $sendfs@snap2
log_must eval "zfs send -nvP -i $sendfs#book $sendfs@snap2 | \
grep '^size' | awk '{print \$2}' >$size"
log_must eval "zfs send -i $sendfs#book $sendfs@snap2 | wc --bytes >$size2"
log_must eval "zfs send -i $sendfs#book $sendfs@snap2 | wc -c >$size2"
bytes1=$(cat $size | tr -d '[[:space:]]')
bytes2=$(cat $size2 | tr -d '[[:space:]]')
[[ "$bytes1" -eq "$bytes2" ]] || \