service restart

Erik Christiansen erik at dd.nec.com.au
Fri Jul 28 07:22:17 UTC 2006


On Fri, Jul 28, 2006 at 08:59:37AM +0200, Ouattara Oumar Aziz wrote:
> >
> :) . It's nicer to type $ service than $ /etc/init.d/ . Also even more 
> interesting is that $ serv +[TAB] gives you $ service . (gain of time).

In that case, please try, in .bashrc :

service () { 
    /etc/init.d/$1 $2
}

Then "service networking restart" should perform
"/etc/init.d/networking restart" for you.
(And command completion works for shell functions too. :-))

Since command completion is working for you, it looks like you're using
a privileged account, rather than sudo, so obviously the shell function
goes into that .bashrc. (Alternatively, whack a sudo in the function, if
you're religious.)

Erik




More information about the ubuntu-users mailing list