Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell 在压缩文件夹中查找特定文件的文件路径_Shell_File_Awk_Find_Zip - Fatal编程技术网

Shell 在压缩文件夹中查找特定文件的文件路径

Shell 在压缩文件夹中查找特定文件的文件路径,shell,file,awk,find,zip,Shell,File,Awk,Find,Zip,我在努力写剧本。我希望找到特定文件的完整文件路径,如以下示例所示: /path/folder\u 06may2017.zip/file\u B.txt 我希望你能帮我解决这个问题。这将非常有用 目录和文件示例 - Folder_01may2017.zip + file_A.txt + file_B.txt - Folder_06may2017.zip + file_A.txt + file_B.txt 我使用过这个命令,但没有成功: 第一次尝试

我在努力写剧本。我希望找到特定文件的完整文件路径,如以下示例所示:
/path/folder\u 06may2017.zip/file\u B.txt

我希望你能帮我解决这个问题。这将非常有用

目录和文件示例

- Folder_01may2017.zip
      + file_A.txt
      + file_B.txt

- Folder_06may2017.zip
      + file_A.txt
      + file_B.txt
我使用过这个命令,但没有成功:

第一次尝试:

find”/path/folder/“-name”*2017年5月6日*“-print-exec-unzip-l{}\ |grep-i“文件”

第一次输出:

182118 2017-05-06 11:20文件\u B.txt

第二次尝试:

find”/path/folder/“-name”*2017年5月6日*“-print-exec-unzip-l{}\ |grep-i'file|B'| awk'{print$4}'${PWD}

第二次输出:

awk:warning:命令行参数“/path/folder”是一个目录:已跳过

第三次尝试:

find”/path/folder“-name”*2017年5月6日*”-exec grep-l“file\u B”/dev/null'{}\

第三次输出

/path/folder/folder\u 2017年5月6日。zip

关于:

$ find "/path/folder" -name "*06may2017*" -exec unzip -l {} \; | awk '$1 ~ /Archive/{zipname = $2}; $4 ~ /file_B/ {printf "%s/%s\n", zipname, $4}'

如何使用输出路径作为复制命令的输入路径?cuz copy命令说它不是一个目录,所以应该有一种方法将其作为字符串读取,对吗?