0

ファイル検索関数で引数を渡す方法を探しています。これにより、コンピューター内のすべてのshファイルに最初にベース名、次にすべてのディレクトリのタブが表示されます。たとえばmyBashfile.sh *sh 、現時点ではこれがあります:while getopts b opt do case $opt in b) find / -name $OPTARG -printf "%f\n"-print 2>/dev/null ;; test1.sh test60.sh anothertest.sh の出力のみを与える esac done wich

しかし、出力として必要です:(タブ付き)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 に答える