Grex Jellyware Conference

Item 115: Unix tool o' the day.

Entered by cross on Sat Sep 18 06:28:48 2010:

1 new of 22 responses total.


#6 of 22 by cross on Wed Sep 22 12:03:41 2010:

resp:5 Nice.  Certainly, example (3) could be rewritten as:

    scp 'grex.org:/bbs/agora33/_*' .

I'm pretty sure that's what John meant when he said it was 
particularly hideous.

Btw: I don't know if you're using Bash or some such shell, but it may 
not be a bad idea to quote the "*" in the back-tick'ed part of the for 
loop in (3).

An often handy flag for ssh is '-C', which compresses the data 
stream.  That can speed up things like this, at the expense of a 
little more CPU and RAM usage on either end of the connection.

If you don't mind running grep on Grex instead of the local end of 
your connection, you could substitute 'grep' for 'cat' in (1).  There 
used to be people on USENET who complained about "useless uses of cat" 
and there was an award.  However, note how this differs: the pipeline 
is spread across the network, and there may be legitimate reasons that 
one does not want to run grep on Grex ("cat" is a much, much simpler 
program).  There are legitimate reasons to use cat in pipelines; this 
could be one of them.

I think that John's examples are very much in the spirit of Unix tool 
usage; 'ssh' certainly counts in this case, particularly for its 
ability to spread computation across the network.  That's an oft-
neglected capability, usually overlooked in favor of people who simply 
want to use it interactively.  I claim that using, e.g., 'scp' is 
certainly more "Unixy" than, say, the sftp or ftp commands.


There are no more items selected.

You have several choices: