[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



Florin Andrei wrote:

Mike McGrath wrote:

On 1/27/07, Florin Andrei <florin 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...


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]