我需要一个基本上这样做的shell脚本:
基本上它是一个脚本,用于替换txt文件列表的zip等价物,但保持相同的名称.
我已经用find找到了我要压缩的文件:
find . -name '.txt.' -print
Run Code Online (Sandbox Code Playgroud)
结果是:
./InstructionManager.txt.0
./InstructionManager.txt.1
Run Code Online (Sandbox Code Playgroud)
这些是我想要单独压缩的文件(当然它们会更多),但不知道如何将它们作为参数单独用于make commans:
zip ./InstructionManager.txt.0.zip ./InstructionManager.txt.0
mv ./InstructionManager.txt.0.zip ./InstructionManager.txt.0
zip ./InstructionManager.txt.1.zip ./InstructionManager.txt.1
mv ./InstructionManager.txt.1.zip ./InstructionManager.txt.1
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?不,我不想要所有文件的拉链:谢谢