[Tipz] useful zsh completions for Redhat systems

Zachary Joress zach at joress.com
Tue Apr 1 19:23:03 EST 2003


These, among others, are available for RedHat in bash as well.
This article describes it: http://www.linux-mag.com/2002-10/potm_01.html
And the RPM is available here:
http://www.caliban.org/files/redhat/RPMS/noarch/bash-completion-20030327
-1.noarch.rpm

-Zach

> -----Original Message-----
> From: Jon Hart <jhart at ccs.neu.edu>
> Sent: Tuesday, April 01, 2003 6:33 PM
> To: tipz at lists.ccs.neu.edu
> Subject: [Tipz] useful zsh completions for Redhat systems
> 
> If you find yourself administering a Redhat box, you may be familiar
with
> the 'service' and 'chkconfig' commands which make service and runlevel
> service manipulation a breeze.
> 
> To dumb it down even more, if you use zsh, you can use the following
> completion rules to tab complete things:
> 
> # a list of the services
> rh_services=(`ls /etc/init.d`)
> # rip out the current runlevel
> runlevel=`runlevel | awk '{print $2}'`
> # find all the services in the current runlevel
> rl_services=(`ls /etc/rc$runlevel.d/S* | xargs -n 1 basename | perl
-ne
> 's/^S\d+//; print'`)
> 
> compctl -k "($rh_services)" chkconfig
> compctl -k "($rl_services)" service
> 
> Its not perfect, but I've been using it for many months and haven't
had
> any
> issues.
> 
> Examples:
> 
> $  chkconfig --level 2345 s<tab>
> saslauthd      smb            snmptrapd      spamassassin   syslog
> single         snmpd          snortd         sshd
> 
> 
> -jon
> 
> _______________________________________________
> Tipz mailing list
> Tipz at lists.ccs.neu.edu
> https://lists.ccs.neu.edu/bin/listinfo/tipz


-------------- next part --------------
z'µìmjÛZržžÜ²Ç+¹¶ÞtÖ¦zz-jö¢•¦åy<©yªi–'¶*'þ»_J,ÞÛ¾ôo+^°7¬rz-jö¢•¦åyJå†Ûi³ÿåŠËlqË'z睻úb¥êæj)¶*sý«miÈfz{lÿm4ßN4×ÿ8FúiïÚ¶Öœ†g§µ¸§


More information about the Tipz mailing list