本文介绍了bash脚本"发现"输出数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何把的结果发现$ 1
到一个数组?
在for循环:
为/ Fdelims = /%% G('发现$ 1')做%% G |切-d \\ / -f6-
解决方案
要遍历一个查找,你可以简单地使用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.
这篇关于bash脚本"发现"输出数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!