On 2020-12-29 1:04 p.m., Ray Andrews wrote:
This snippet pretty well does it, mind I'm still interested in trying to use completion:I presume Ray wants something like "complete ma", which would return "make man ..." essentially everything that typing "ma<tab>" would return. Yeah, just that Filipe.
{
local dirs=( $1*(N) )
for ((aa = 1; aa <= $#dirs; aa++)); do
! [ -d "$dirs[$aa]" ] && dirs[$aa]=''
done
dirs=($dirs) #How do folks survive who don't know this?
[ "$#dirs" -eq 1 ] && cd "$dirs[1]"
# else, fall through to n_list():
}