How to define a function in bash and select one of the files with the same name for editing after finding multiple files with the same name?

such as the title.

the function I implement now is to find the first file even if I open it with vim for editing:

vfin() {vim $(find / -iname "$1")}

but most of the time, you need to select one of the multiple files with the same name to edit. How do you do this with the bash function?

Sep.04,2021

use the pipe to fetch the first line

vim $(find / -iname "$1" | head -n 1)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3168b-2bd87.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3168b-2bd87.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?