且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

bash脚本"发现"输出数组

更新时间:2022-10-15 11:20:21

要遍历一个查找,你可以简单地使用find:

 在'发现$ 1`的文件;做
    回声$文件|切-d / -f6-
DONE

这是我从你的问题了。

How do I put the result of find $1 into an array?

In for loop:

for /f "delims=/" %%G in ('find $1') do %%G | cut -d\/ -f6-

To loop through a find, you can simply use find:

for file in "`find "$1"`"; do
    echo "$file" | cut -d/ -f6-
done

It was what I got from your question.