# cryptdisks_{start,stop} completion by first row of crypttab # # Copyright 2013 Claudius Hubig , 2-clause BSD _cryptdisks() { local tf; tf=${TABFILE-"/etc/crypttab"}; COMPREPLY=($(egrep -v "^[[:space:]]*(#|$)" "${tf}" | egrep -o "^${COMP_WORDS[COMP_CWORD]}[^[:space:]]*")); return 0; } complete -F _cryptdisks cryptdisks_start; complete -F _cryptdisks cryptdisks_stop;