summaryrefslogtreecommitdiff
path: root/bash_completion
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2010-01-04 18:00:46 +0200
committerVille Skyttä <ville.skytta@iki.fi>2010-01-04 18:15:10 +0200
commitdb739401f78f5479ece0eb7a7a0ef725d89d2e2d (patch)
tree97eb5a399f8ad35cd546195bb7ae1a2f1f39790b /bash_completion
parent4ec77ce531525595d9acbe01d02064445da3e8c8 (diff)
downloadbash-completion-db739401f78f5479ece0eb7a7a0ef725d89d2e2d.tar.gz
sed portability fixes.
Use \{0,1\} (POSIX BRE) instead of \? or empty subexpression alternatives.
Diffstat (limited to 'bash_completion')
-rw-r--r--bash_completion4
1 files changed, 2 insertions, 2 deletions
diff --git a/bash_completion b/bash_completion
index 6b2f28f7..e0476743 100644
--- a/bash_completion
+++ b/bash_completion
@@ -764,7 +764,7 @@ _modules()
local modpath
modpath=/lib/modules/$1
COMPREPLY=( $( compgen -W "$( command ls -R $modpath | \
- sed -ne 's/^\(.*\)\.k\?o\(\|.gz\)$/\1/p' )" -- "$cur" ) )
+ sed -ne 's/^\(.*\)\.k\{0,1\}o\(\.gz\)\{0,1\}$/\1/p' )" -- "$cur" ) )
}
# This function completes on installed modules
@@ -1376,7 +1376,7 @@ _known_hosts_real()
# append any available aliases from config files
if [[ ${#config[@]} -gt 0 && -n "$aliases" ]]; then
- local hosts=$( sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\?['"$'\t '"']\{1,\}\([^#*?]*\)\(#.*\)\?$/\2/p' "${config[@]}" )
+ local hosts=$( sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\{0,1\}['"$'\t '"']\{1,\}\([^#*?]*\)\(#.*\)\{0,1\}$/\2/p' "${config[@]}" )
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -P "$prefix$user" \
-S "$suffix" -W "$hosts" -- "$cur" ) )
fi