From 4de260efe3375fe62b9d80452b9203c89ab0c045 Mon Sep 17 00:00:00 2001 From: Derek Schrock Date: Thu, 6 Jun 2024 20:37:26 -0400 Subject: [PATCH] contrib/bash_completion.d: squelch FreeBSD seq when first < last With seq x -1 z and x is less than z FreeBSD seq will print the error: $ seq 1 -1 2 seq: needs positive increment Hide this error. Alternatively $COMP_CWORD could be checked for < 2. Reviewed-by: Brian Behlendorf Signed-off-by: Derek Schrock Closes #16234 --- contrib/bash_completion.d/zfs.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bash_completion.d/zfs.in b/contrib/bash_completion.d/zfs.in index c5cfd8e8ef..dbeb10d899 100644 --- a/contrib/bash_completion.d/zfs.in +++ b/contrib/bash_completion.d/zfs.in @@ -155,7 +155,7 @@ __zfs_list_volumes() __zfs_argument_chosen() { local word property - for word in $(seq $((COMP_CWORD-1)) -1 2) + for word in $(seq $((COMP_CWORD-1)) -1 2 2>/dev/null) do local prev="${COMP_WORDS[$word]}" if [[ ${COMP_WORDS[$word-1]} != -[tos] ]]