我正在寻找如何在查找文件函数中传递参数这应该首先为我的计算机中的所有 sh 文件提供基本名称一个选项卡,然后是所有目录例如myBashfile.sh *sh
目前我有这个:while getopts b opt do case $opt in b) find / -name $OPTARG -printf "%f\n"-print 2>/dev/null ;; esac done 仅给出 test1.sh test60.sh anothertest.sh 的输出
但我需要作为输出:(带有选项卡)test1.sh /home/directory5/directory6 test60.sh /home/directory50/directory6 anothertest.sh /home/directory5/directory6
谁能帮帮我?