[H-GEN] Encrypting a tar backup

Anthony Towns aj at azure.humbug.org.au
Fri Oct 25 01:32:43 EDT 2002


On Thu, Oct 24, 2002 at 10:51:28AM -0400, Jason Parker-Burlingham wrote:
> Christopher Biggs <chris at stallion.oz.au> writes:
> > Granted that "cat file | pipeline" is a no-op, I *still* do it fairly
> > often because I like to compose my shellscripts with my thoughts in
> > order, rather than
> Sure.  cat is usually a good indicator that the programmer is a novice
> (nothing wrong with that, but it's nice to let novices know there's a
> better way[1]) or that they know what they're doing and like it that
> way.

Meh, I still tend to prefer having "cat" up front for many of my one
liners. Like, for example:

 $ cat /var/log/apache/access.log  | grep Packages.gz | cut -d\  -f6- | sed 's,woody,stable,;s,sarge,testing,;s,sid,unstable,;s,contrib,main,;s,non-free,main,;s,potato,oldstable,;s,HTTP.*$,,' | grep -v experimental | sort | uniq -c  | sort -n | tail 

Having a no op at the front which says "this is the file I'm working on",
and then having *all* of what you're doing to it afterwards is convenient,
at least for me.

That command later became:

 $ zcat -f /var/log/apache/access.log{,.1,.2.gz,.3.gz}  | grep Packages.gz | cut -d\  -f1,6- | sed 's,woody,stable,;s,sarge,testing,;s,sid,unstable,;s,contrib,main,;s,non-free,main,;s,potato,oldstable,;' | grep -v experimental | sort > foo.txt
 $ for a in alpha arm hppa i386 ia64 m68k mips mipsel sparc powerpc s390; do echo -n "$a: ";  grep "binary-$a" foo.txt | cut -d\  -f1 | sort | uniq -c | wc -l; done | column -t | sort -n +1

and changing a cat to a zcat is a bit more straightforward than changing a
"<" into a zcat or a <(zcat ...).

Cheers,
aj

-- 
Anthony Towns <aj at humbug.org.au> <http://azure.humbug.org.au/~aj/>
I don't speak for anyone save myself. GPG signed mail preferred.

 ``If you don't do it now, you'll be one year older when you do.''
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 350 bytes
Desc: not available
URL: <http://lists.humbug.org.au/pipermail/general/attachments/20021025/3170f097/attachment.sig>


More information about the General mailing list