provide a 7zcat alias and a way to compress directly from stdin to stdout

Bug #383667 reported by Everthon Valadão
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
p7zip (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: p7zip

1) Sometimes you just want to "grep" someting in a compressed text file, but it is too big to be decompressed and then processed. This is why I love zcat and bzcat: I could decompress and pipe it on the flow to grep/awk/whatever, but unfortunately I do not see a 7zip cat like. 7zip command line options are too many and hard to remember, so I put this alias in my ~/.bashrc:

    alias 7zcat='7za e $@ -so 2> /dev/null'

I wish this alias came pre-installed with p7zip :-)
OBS.: the redirection of stderr to /dev/null is because 7z doesn't have a --quiet option (could you fix this too?)

2) I wonder if there is some way to compress with 7zip exactly like I do with gzip:
    echo "foo" | gzip -c > foo.gz
The 7zip manpage gives this example (with gzip compression):
    echo "foo" | 7za a dummy -tgzip -si -so > foo.gz
but with 7zip compression, the closest I got was
    echo "foo" | 7za a -t7z -si foo.7z
so, how to redirect the output to /dev/stdout when reading from /dev/stdin? I mean, it is this possible via some bash-fu, named pipes, etc?

original source: http://mobilevs.blogspot.com/2009/06/7zcat.html

Tags: 7zcat alias zcat
Revision history for this message
Mohammed Adnène Trojette (adn+ubuntu) wrote : Re: [Bug 383667] [NEW] provide a 7zcat alias and a way to compress directly from stdin to stdout

On Thu, Jun 04, 2009, Everthon Valadão wrote:
> (snip)
> alias 7zcat='7za e $@ -so 2> /dev/null'
> (snip)
> 2) I wonder if there is some way to compress with 7zip exactly like I do with gzip:
> (snip)

You should use lzma.

--
Mohammed Adnène Trojette

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.