On 6/23/2015 4:26 PM, Reindl Harald wrote:

Am 24.06.2015 um 01:07 schrieb Chad:
You could do something like:

systemctl start htt<tab>
systemctl st<tab>

or else, and it will complete it.
I use bash. This is a cool trick that systemd has over init.d. I know
not all programs can do that shell completion, for example
/etc/init.d/httpd res<tab> does not work (I try it all the time out of
tab completion habit!)

not true, that's just because you don't use the correct command and call a script which is not known to bash-completion directly

[root@honeypot:~]$ service honeypot
restart  start    status   stop
[root@honeypot:~]$ service honeypot ^C
[root@honeypot:~]$ cat /etc/redhat-release
CentOS release 6.6 (Final)

Name        : bash-completion
Arch        : noarch
Epoch       : 1
Version     : 1.3
Release     : 7.el6
Size        : 576 k
Repo        : installed
Summary     : Programmable completion for Bash
URL        : http://bash-completion.alioth.debian.org/
License     : GPLv2+
Beschreibung : bash-completion is a collection of shell functions that take 
advantage
             : of the programmable completion feature of bash.

[root@honeypot:~]$ rpm -q --file /etc/bash_completion.d/service
bash-completion-1.3-7.el6.noarch


Mr. Harald,
Thanks again for your reply, I did not have bash-completion installed (and did 
not know it existed).
I installed it on one of the servers and sure enough res<tab> completes to 
"restart" now!
Cool, I will be adding that to all my servers and to my new server set-up 
scripts and notes.
Super awesome feature!

^C

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to