diff --git a/bash_completion b/bash_completion index 3bade058..46eda1d6 100644 --- a/bash_completion +++ b/bash_completion @@ -594,8 +594,8 @@ _pnames() # Not using "ps axo comm" because under some Linux kernels, it # truncates command names (see e.g. http://bugs.debian.org/497540#19) COMPREPLY=( $( compgen -W '$( command ps axo command= | \ - sed -e "s/ .*//; s:.*/::; s/:$//;" \ - -e "s/^[[(-]//; s/[])]$//" \ + sed -e "s/ .*//" -e "s:.*/::" -e "s/:$//" \ + -e "s/^[[(-]//" -e "s/[])]$//" \ -e "s/^$//")' \ -- "$cur" ) ) } @@ -767,8 +767,8 @@ _service() if [[ $COMP_CWORD -eq 1 ]] && [[ $prev == "service" ]]; then _services else - COMPREPLY=( $( compgen -W '`sed -ne "y/|/ /; \ - s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \ + COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \ + -ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \ $sysvdir/${prev##*/} 2>/dev/null`' -- "$cur" ) ) fi diff --git a/contrib/cvs b/contrib/cvs index 581182a4..9aeef525 100644 --- a/contrib/cvs +++ b/contrib/cvs @@ -254,7 +254,7 @@ _cvs() cvsroot) if [ -r ~/.cvspass ]; then # Ugly escaping because of bash treating ':' specially - cvsroots=$( sed 's/^[^ ]* //; s/:/\\:/g' ~/.cvspass ) + cvsroots=$( sed -e 's/^[^ ]* //' -e 's/:/\\:/g' ~/.cvspass ) COMPREPLY=( $( compgen -W '$cvsroots' -- "$cur" ) ) fi ;; diff --git a/contrib/gdb b/contrib/gdb index 8c8cb8d0..0cbf1ec7 100644 --- a/contrib/gdb +++ b/contrib/gdb @@ -21,7 +21,7 @@ _gdb() # names manually. IFS=":" local path_array=( $( echo "$PATH" | \ - sed 's/:\{2,\}/:/g;s/^:\|:$//g' ) ) + sed -e 's/:\{2,\}/:/g' -e 's/^:\|:$//g' ) ) IFS=$'\n' COMPREPLY=( $( compgen -d -W '$(find "${path_array[@]}" . \ -mindepth 1 -maxdepth 1 -not -type d -executable \ diff --git a/contrib/gpg b/contrib/gpg index 76c845a1..49bfe040 100644 --- a/contrib/gpg +++ b/contrib/gpg @@ -17,7 +17,8 @@ _gpg() --@(export|@(?(l|nr|nrl)sign|edit)-key)) # return list of public keys COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \ - sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p;s@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur" )) + sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \ + -ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) return 0 ;; -@(r|-recipient)) diff --git a/contrib/gpg2 b/contrib/gpg2 index 607797c5..eff4b3c3 100644 --- a/contrib/gpg2 +++ b/contrib/gpg2 @@ -21,7 +21,8 @@ _gpg2 () --@(export|@(?(l|nr|nrl)sign|edit)-key)) # return list of public keys COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \ - sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p;s@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur" )) + sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \ + -ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) return 0 ;; -@(r|-recipient)) diff --git a/contrib/sysv-rc b/contrib/sysv-rc index ac2062be..a11c9b12 100644 --- a/contrib/sysv-rc +++ b/contrib/sysv-rc @@ -93,8 +93,8 @@ _invoke_rc_d() ) ) COMPREPLY=( $( compgen -W '${valid_options[@]} ${services[@]}' -- "$cur" ) ) elif [ -x $sysvdir/$prev ]; then - COMPREPLY=( $( compgen -W '`sed -ne "y/|/ /; \ - s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \ + COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \ + -ne "s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \ $sysvdir/$prev`' -- "$cur" ) ) else COMPREPLY=()