I had finessed in bash a function that changes to any directory below the current working directory by having that directory name as a parameter to the function. If there are multiple results by that name, a menu appears to allow the user to choose the intended destination. The bash code is:
function cdb() {
select dir in $(find -type d -name "$1" -not -path '*/\.*' -prune);
do
cd "${dir}" && break;
done
}
An example it of at play would be:
android@cybaryme:~/octos$ cdb av
1) ./frameworks/av
2) ./system/bt/bta/av
#? 1
android@cybaryme:~/octos/frameworks/av$
I use fish most of the time though, and would like to have this function there as well. But for the life of me I cannot find the select command, or its equivalent. Possibly thought that "complete" would do the job, but I got confused over what it is for.
Can anyone shed light on what is available? Or maybe an example of a Perl script that can shim the missing gaps?