私がやろうとしているのは、次の行に沿ったものです(これは疑似コードです):
for txt in $(some fancy command ./*.txt); do
some command here $txt
私がやろうとしているのは、次の行に沿ったものです(これは疑似コードです):
for txt in $(some fancy command ./*.txt); do
some command here $txt
使用できますfind
:
find /path -type f -name "*.txt" | while read txt; do
echo "$txt"; # Do something else
done
-exec
次のオプションを使用しfind
ます。
find /usr/share/wordlists/*/* -type f -name '*.txt' -exec yourScript {} \;
試す
find . | grep ".txt" | xargs -I script.sh {}
find は、ディレクトリ内のすべてのファイルを返します。grep は .txt ファイルのみを選択し、xargs はそのファイルをパラメーターとして script.sh に送信します。