【发布时间】:2011-05-18 10:19:33
【问题描述】:
for f in $(for i in $(find Balzac/ -iname "20??????.txt"); do echo $i; done); do cat $f|cut -c 10-21; done|sort|uniq|egrep -Re "[0-9][0-9][0-9]-[0-9][0-9][0-9].mp3"
从我们使用的基于 .txt 的播放列表中生成一个排序的、唯一的列表。
a=$(for f in $(for i in $(find Balzac/ -iname "20??????.txt"); do echo $i; done); do cat $f|cut -c 10-21; done|sort|uniq|egrep -Re "[0-9][0-9][0-9]-[0-9][0-9][0-9].mp3")
虽然只包含该列表的最后一个值。
知道为什么以及我可以做些什么来在我的变量中包含 整个列表?我迷路了……
最后我需要上面的两个变体来比较/比较输出,看看两个目录中包含的文件有什么不同。
【问题讨论】:
标签: bash command substitution