PageRenderTime 20ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion_lib/complete/rmmod

http://github.com/brinkman83/bashrc
#! | 18 lines | 12 code | 6 blank | 0 comment | 0 complexity | 76c4f69a62891851e7c388e5d25a0bb9 MD5 | raw file
 1# Linux rmmod(8) completion. This completes on a list of all currently
 2# installed kernel modules.
 3
 4
 5comp_include _get_cword
 6
 7
 8_rmmod()
 9{
10    local cur
11
12    COMPREPLY=()
13    cur=`_get_cword`
14
15    COMPREPLY=( $( /sbin/lsmod | \
16          awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}' 2>/dev/null ))
17    return 0
18} # _rmmod()