@@ -2072,12 +2072,12 @@ if [[ $OSTYPE == *@(solaris|aix)* ]]; then
20722072 # This function completes on process IDs.
20732073 _comp_compgen_pids ()
20742074 {
2075- _comp_compgen_split -- " $( command ps -efo pid | tail -n +2) "
2075+ _comp_compgen_split -- " $( command ps -efo pid | _comp_tail -n +2) "
20762076 }
20772077
20782078 _comp_compgen_pgids ()
20792079 {
2080- _comp_compgen_split -- " $( command ps -efo pgid | tail -n +2) "
2080+ _comp_compgen_split -- " $( command ps -efo pgid | _comp_tail -n +2) "
20812081 }
20822082 _comp_compgen_pnames ()
20832083 {
@@ -2098,7 +2098,7 @@ else
20982098 {
20992099 local -a procs=()
21002100 if [[ ${1-} == -s ]]; then
2101- _comp_split procs " $( command ps ax -o comm | tail -n +2) "
2101+ _comp_split procs " $( command ps ax -o comm | _comp_tail -n +2) "
21022102 else
21032103 # Some versions of ps don't support "command", but do "comm", e.g.
21042104 # some busybox ones. Fall back
@@ -3560,20 +3560,33 @@ _comp_xfunc()
35603560 " $xfunc_name " " ${@: 3} "
35613561}
35623562
3563- # Call a POSIX-compatible awk. Solaris awk is not POSIX-compliant, but Solaris
3564- # provides a POSIX-compatible version through /usr/xpg4/bin/awk. We switch the
3565- # implementation to /usr/xpg4/bin/awk in Solaris if any.
3563+ # Call a POSIX-compatible awk and tail. Solaris awk and tail are not
3564+ # POSIX-compliant, but Solaris provides POSIX-compatible versions through
3565+ # /usr/xpg4/bin/{awk,tail}. We switch the implementation to
3566+ # /usr/xpg4/bin/{awk,tail} in Solaris if any.
35663567# @since 2.12
3567- if [[ $OSTYPE == * solaris* && -x /usr/xpg4/bin/awk ]]; then
3568- _comp_awk ()
3569- {
3570- /usr/xpg4/bin/awk " $@ "
3571- }
3572- else
3573- _comp_awk ()
3574- {
3575- command awk " $@ "
3576- }
3568+ _comp_awk ()
3569+ {
3570+ command awk " $@ "
3571+ }
3572+ # @since 2.18
3573+ _comp_tail ()
3574+ {
3575+ command tail " $@ "
3576+ }
3577+ if [[ $OSTYPE == * solaris* ]]; then
3578+ if [[ -x /usr/xpg4/bin/awk ]]; then
3579+ _comp_awk ()
3580+ {
3581+ /usr/xpg4/bin/awk " $@ "
3582+ }
3583+ fi
3584+ if [[ -x /usr/xpg4/bin/tail ]]; then
3585+ _comp_tail ()
3586+ {
3587+ /usr/xpg4/bin/tail " $@ "
3588+ }
3589+ fi
35773590fi
35783591
35793592# List custom/extra completion files to source on the startup
0 commit comments