On 2024-07-29 12:05 +02, Jan Stary <h...@stare.cz> wrote:
> On Jul 29 11:44:32, develo...@robert-palm.de wrote:
>> complete -cf doas
>> 
>> but I cannot figure out how to do this for ksh.
>> 

in .kshrc:

set -A complete_doas_1 -- $(ls /sbin /usr/sbin /bin /usr/bin /usr/X11R6/bin \
    /usr/local/sbin /usr/local/bin)

> Why stop here? It would be "nice" if tab-completion would complete
> the hostnames from ~/.ssh/known_hosts when you have already said 'ssh';

again, in .kshrc:

HOST_LIST=`awk '{print $1}' < ~/.ssh/known_hosts | cut -f 1 -d, \
    | egrep -v '^[[:digit:]]|^$|\:\:' | sort -u`

set -A complete_ssh -- ${HOST_LIST}
set -A complete_ping -- ${HOST_LIST}
set -A complete_ping6 -- ${HOST_LIST}
set -A complete_traceroute -- ${HOST_LIST}
set -A complete_traceroute6 -- ${HOST_LIST}

-- 
In my defence, I have been left unsupervised.

Reply via email to