0

我正在寻找如何在查找文件函数中传递参数这应该首先为我的计算机中的所有 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

谁能帮帮我?

4

1 回答 1

1

一个全面的答案手册。简单来说:

$1 # means the 1st argument
$2 # means the 2nd argument
$@ # means all arguments
于 2012-06-08T14:22:53.173 回答