SUSE Conversations


Uniformity Across Your Linux Platform

maggot62

By: maggot62

January 14, 2009 12:42 pm

Reads:135

Comments:0

Rating:0

It has been traditional within SUSE that service scripts are activated with a symbolic link usually in /usr/sbin. So that to start the sshd service you can issue the command rcsshd start as root from anywhere as the /usr/sbin directory is in the search path. Of course you also would be able to use the syntax /etc/init.d/sshd start , but this has always been a little long winded ;(

Moreover, these symlinks are not available in RedHat or CENTOS. They have the standard command: service . The problem with the command service is that you have to know the service name. You cannot use tab completion. So let’s fix that!

 complete -W "$(ls /etc/init.d/)" service
  • complete : the command complete sets up tab completion
  • -W : this option creates a word list for completion
  • “$(ls /etc/init.d/)” : out word list is made up of the output of the command ls /etc/init.d/
  • service : this then sets up the configured completion for the command service

Test and enjoy!

If you want this all the time add it to your ~/.bashrc

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags:
Categories: SUSE Linux Enterprise, SUSE Linux Enterprise Desktop, SUSE Linux Enterprise Server, Technical Solutions

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.

Comment

RSS