【发布时间】:2014-03-06 13:23:33
【问题描述】:
// Gets all the image names in a directory and its subdirectories then appends them to an array called allFiles.
allFiles =$(ls -R | grep -E "(jpg|png\gif)")
// Gets all the image names used in list.txt and appends them to an array called list.
list=$(grep -Po '".*?"' list.xml | rev | cut -c 2- | rev | cut -c 2-)
for file in AllFiles
do
notFound = 1
脚本应查看所有文本类型的扩展名(例如:txt、cpp、py、c、html、xml、json)并创建引用的图像文件列表。这包括不在当前工作文件夹中的文件,但也包括在其中的文件夹中的文件。然后它应该获取此列表并将其与当前目录中的图像文件列表(例如:jpg、png、gif)进行比较。如果一个文件存在于目录中,但没有被当前目录中的任何文件引用,则应在最后将其打印为未引用文件。不知道我做错了什么。有人请帮忙
【问题讨论】:
标签: shell file-extension