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"
Asked
Active
Viewed 6,474 times
7

arcull
- 281
- 1
- 4
- 11
-
It's not possible unless `7za` is reading a single file from `stdin`. – konsolebox Jul 18 '14 at 07:00
1 Answers
12
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.

arcull
- 281
- 1
- 4
- 11