PageRenderTime 154ms CodeModel.GetById 152ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion_lib/include/_services

http://github.com/brinkman83/bashrc
#! | 15 lines | 13 code | 2 blank | 0 comment | 0 complexity | c8350a4eca30ce1604485d0c833c5564 MD5 | raw file
 1# This function completes on services
 2#
 3_services()
 4{
 5	local sysvdir famdir
 6	[ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d
 7	famdir=/etc/xinetd.d
 8	COMPREPLY=( $( builtin echo $sysvdir/!(*.rpmsave|*.rpmorig|*~|functions)) )
 9
10	if [ -d $famdir ]; then
11		COMPREPLY=( ${COMPREPLY[@]} $( builtin echo $famdir/!(*.rpmsave|*.rpmorig|*~)) )
12	fi
13
14	COMPREPLY=( $( compgen -W '${COMPREPLY[@]#@($sysvdir|$famdir)/}' -- $cur ) )
15}