1

私がやろうとしているのは、次の行に沿ったものです(これは疑似コードです):

for txt in  $(some fancy command ./*.txt); do
some command here $txt
4

3 に答える 3

3

使用できますfind

find /path -type f -name "*.txt" | while read txt; do
  echo "$txt";   # Do something else
done
于 2013-11-08T06:34:59.850 に答える
0

-exec次のオプションを使用しfindます。

find /usr/share/wordlists/*/* -type f -name '*.txt' -exec yourScript {} \;
于 2013-11-08T06:43:36.260 に答える
0

試す

find . | grep ".txt" | xargs -I script.sh {}

find は、ディレクトリ内のすべてのファイルを返します。grep は .txt ファイルのみを選択し、xargs はそのファイルをパラメーターとして script.sh に送信します。

于 2013-11-08T06:38:17.313 に答える