[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 08e746ea109366cd1ba6b52cb02e95c094726876

Ville Skyttä ville.skytta at iki.fi
Mon Jan 18 17:29:14 UTC 2010


The following commit has been merged in the master branch:
commit 6f235980a80ff98600f2f5cc2268ef8a4304ddae
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Jan 18 18:53:41 2010 +0200

    sed portability fixes (avoid '\|').

diff --git a/contrib/_yum b/contrib/_yum
index f7502a3..7ec3b1a 100644
--- a/contrib/_yum
+++ b/contrib/_yum
@@ -10,7 +10,7 @@ _yum_list()
         # Try to strip in between headings like "Available Packages"
         # This will obviously only work for English :P
         COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \
-            sed -ne '/^\(Available\|Installed\|Updated\) /d' \
+            sed -ne '/^Available /d' -e '/^Installed /d' -e '/^Updated /d' \
             -e 's/[[:space:]].*//p' ) )
     else
         # Drop first line (e.g. "Updated Packages")
@@ -25,7 +25,7 @@ _yum_repolist()
     # http://yum.baseurl.org/ticket/83
     # Drop first ("repo id      repo name") and last ("repolist: ...") rows
     yum --noplugins -C repolist $1 2>/dev/null | \
-        sed -ne '/^repo\(\s\s*id\|list:\)/d' -e 's/[[:space:]].*//p'
+        sed -ne '/^repo\s\s*id/d' -e '/^repolist:/d' -e 's/[[:space:]].*//p'
 }
 
 _yum_plugins()
diff --git a/contrib/gdb b/contrib/gdb
index 04e725c..e33ec02 100644
--- a/contrib/gdb
+++ b/contrib/gdb
@@ -21,7 +21,7 @@ _gdb()
             # names manually.
             IFS=":"
             local path_array=( $( \
-                sed -e 's/:\{2,\}/:/g' -e 's/^:\|:$//g' <<<"$PATH" ) )
+                sed -e 's/:\{2,\}/:/g' -e 's/^://' -e 's/:$//' <<<"$PATH" ) )
             IFS=$'\n'
             COMPREPLY=( $( compgen -d -W '$(find "${path_array[@]}" . \
                 -mindepth 1 -maxdepth 1 -not -type d -executable \
diff --git a/contrib/postfix b/contrib/postfix
index 0dfd93b..2a65051 100644
--- a/contrib/postfix
+++ b/contrib/postfix
@@ -107,7 +107,7 @@ _postcat()
         len=${#cur}
         idx=0
         for pval in $( mailq 2>/dev/null | \
-            sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* !].*$//' ); do
+            sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do
             if [[ "$cur" == "${pval:0:$len}" ]]; then
                 COMPREPLY[$idx]=$pval
                 idx=$(($idx+1))
@@ -183,7 +183,7 @@ _postsuper()
             len=${#cur}
             idx=0
             for pval in ALL $( mailq 2>/dev/null | \
-                sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* !].*$//' ); do
+                sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do
                 if [[ "$cur" == "${pval:0:$len}" ]]; then
                     COMPREPLY[$idx]=$pval
                     idx=$(($idx+1))
@@ -195,7 +195,7 @@ _postsuper()
             len=${#cur}
             idx=0
             for pval in ALL $( mailq 2>/dev/null | \
-                sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* ].*$//; /!$/d' ); do
+                sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d' ); do
                 if [[ "$cur" == "${pval:0:$len}" ]]; then
                     COMPREPLY[$idx]=$pval
                     idx=$(($idx+1))
@@ -207,7 +207,7 @@ _postsuper()
             len=${#cur}
             idx=0
             for pval in ALL $( mailq 2>/dev/null | \
-                sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do
+                sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do
                 if [[ "$cur" == "${pval:0:$len}" ]]; then
                     COMPREPLY[$idx]=$pval
                     idx=$(($idx+1))

-- 
bash-completion



More information about the Bash-completion-commits mailing list