diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2010-01-18 18:53:41 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2010-01-18 18:53:41 +0200 |
commit | 6f235980a80ff98600f2f5cc2268ef8a4304ddae (patch) | |
tree | 16776e29ebfe1a5c979ec9273e49af7ebe044514 | |
parent | 556d1304d0ae18c6876407c99e575cf78376e694 (diff) | |
download | bash-completion-6f235980a80ff98600f2f5cc2268ef8a4304ddae.tar.gz |
sed portability fixes (avoid '\|').
-rw-r--r-- | contrib/_yum | 4 | ||||
-rw-r--r-- | contrib/gdb | 2 | ||||
-rw-r--r-- | contrib/postfix | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/contrib/_yum b/contrib/_yum index f7502a3e..7ec3b1aa 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 04e725cb..e33ec029 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 0dfd93b5..2a650511 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)) |