Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pipe 7z output to 7z

Tags:

pipe

7zip

I'm writing a bash script which should extract content of one 7z file and compress that extracted content to a new 7z file. The command I've tried is 7z x -o/tmp/ "/home/file1.7z" | 7z a -t7z "/home/file2.7z"

like image 967
arcull Avatar asked Jul 18 '14 06:07

arcull


1 Answers

ok, found out how to do it: 7z x "/home/file1.7z" -so | 7z a -si "/home/file2.7z" "so" switch is needed, meaning that instead of extracting content to folder it should extract to stdout, same analogy goes for "si" switch.

like image 141
arcull Avatar answered Oct 20 '22 19:10

arcull