From 3f0322b73d98c177ede1973ad1b84e66ee593ca9 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 23 Nov 2023 09:34:18 +0900 Subject: [PATCH] fix(iperf,puppet): use \{m,n\} instead of \? and \+ for POSIX sed \? and \+ in BRE are GNU extensions. --- completions/iperf | 4 ++-- completions/puppet | 2 +- test/update-test-cmd-list | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/completions/iperf b/completions/iperf index bf97de705e5..016881463ac 100644 --- a/completions/iperf +++ b/completions/iperf @@ -73,10 +73,10 @@ _comp_cmd_iperf() for i in "${words[@]}"; do case $i in -s | --server) - filter=(command sed -e '/^Client.specific/,/^\(Server.specific.*\)\?$/d') + filter=(command sed -e '/^Client.specific/,/^\(Server.specific.*\)\{0,1\}$/d') ;; -c | --client) - filter=(command sed -e '/^Server.specific/,/^\(Client.specific.*\)\?$/d') + filter=(command sed -e '/^Server.specific/,/^\(Client.specific.*\)\{0,1\}$/d') ;; esac done diff --git a/completions/puppet b/completions/puppet index 0bde46f513c..a6f5d5985e7 100644 --- a/completions/puppet +++ b/completions/puppet @@ -24,7 +24,7 @@ _comp_cmd_puppet__certs() if [[ $1 == --all ]]; then cert_list=$( $puppetca --list --all | - command sed -e 's/^[+-]\{0,1\}\s*\(\S\+\)\s\+.*$/\1/' + command sed -e 's/^[+-]\{0,1\}\s*\(\S\{1,\}\)\s\{1,\}.*$/\1/' ) else cert_list=$("$puppetca" --list) diff --git a/test/update-test-cmd-list b/test/update-test-cmd-list index 3cca459d67d..20224b445a9 100755 --- a/test/update-test-cmd-list +++ b/test/update-test-cmd-list @@ -9,6 +9,6 @@ mydir=$( cat "$mydir"/t/test_*.py | tr -d '\n' | grep -Eo '@pytest.mark.complete\(([^)]*\[^)]*)\)' | - sed -ne 's/^[^"]*"\\\?\([^_][^[:space:]"]*\)[[:space:]"].*/\1/p' | + sed -ne 's/^[^"]*"\\\{0,1\}\([^_][^[:space:]"]*\)[[:space:]"].*/\1/p' | LC_ALL=C sort -u \ >"$mydir"/test-cmd-list.txt