/etc/init.d in the default $PATH ?

Dmitry Butskoy buc at odusz.so-cdu.ru
Mon Jan 29 12:29:47 UTC 2007


Florin Andrei wrote:

> Mike McGrath wrote:
>
>> On 1/27/07, Florin Andrei <florin at andrei.myip.org> wrote:
>>
>>> So, what it the rationale for /etc/init.d not being in the default
>>> $PATH, for root at least?
>>
>>
>> because "/sbin/service" is...
>
>
> I know what you mean, but TAB completion doesn't work on the service 
> name when using /sbin/service
>

Try this  (you can place it as "/etc/profile.d/service.sh"):

_service_func ()
{
    COMPREPLY=( $(cd /etc/init.d; ls ${2}* ) )
}
complete -F _service_func service


Regards,
Dmitry Butskoy
http://www.fedoraproject.org/wiki/DmitryButskoy

P.S. see /usr/share/doc/bash-*/complete/* for examples...




More information about the fedora-devel-list mailing list