Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/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
Shell 有没有办法对tar的输入进行预处理?_Shell_Unix_Command Line_Tar - Fatal编程技术网

Shell 有没有办法对tar的输入进行预处理?

Shell 有没有办法对tar的输入进行预处理?,shell,unix,command-line,tar,Shell,Unix,Command Line,Tar,像这样的东西会很棒: tar cvzf file.tgz input_dir --exclude '.*' --preprocess "tr '[A-Za-z]' '[N-ZA-Mn-za-m]'" 这个预处理步骤会作用于文件名还是文件内容?理想情况下两者都会。似乎--to命令只适用于tarxf。如果你只是想找一个工具来处理文件名,你可以做一些类似于find input_dir | tr which | tar cvzf file.tgz-t-的事情来告诉tar要包含哪些文件。在find级别添

像这样的东西会很棒:

tar cvzf file.tgz input_dir --exclude '.*' --preprocess "tr '[A-Za-z]' '[N-ZA-Mn-za-m]'"

这个
预处理
步骤会作用于文件名还是文件内容?理想情况下两者都会。似乎--to命令只适用于
tarxf
。如果你只是想找一个工具来处理文件名,你可以做一些类似于
find input_dir | tr which | tar cvzf file.tgz-t-
的事情来告诉
tar
要包含哪些文件。在
find
级别添加任何排除项。至于数据,我认为您需要创建临时文件,因为
tar
存储元数据和其他信息,因此它无法从标准中重新创建。是的,我认为您可能是对的。谢谢