Re: [gentoo-user] [OT] One line script for md5sum

2008-12-17 Thread Alan McKinnon
On Thursday 18 December 2008 00:31:56 Robert Bridge wrote: > On Thu, 18 Dec 2008 00:17:18 +0200 > > Alan McKinnon wrote: > > On Wednesday 17 December 2008 22:42:34 Robert Bridge wrote: > > > Or use a wildcard based match. > > > > > > namestat.text works, as would name*stat.text > > > > > > na

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-17 Thread Robert Bridge
On Thu, 18 Dec 2008 00:17:18 +0200 Alan McKinnon wrote: > On Wednesday 17 December 2008 22:42:34 Robert Bridge wrote: > > > Or use a wildcard based match. > > > > namestat.text works, as would name*stat.text > > > name0[01][0-9]{2}stat.text > > > would be better still > more typing...

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-17 Thread Alan McKinnon
On Wednesday 17 December 2008 22:42:34 Robert Bridge wrote: > On Wed, 17 Dec 2008 15:33:35 -0500 > > Willie Wong wrote: > > On Wed, Dec 17, 2008 at 08:48:52AM +, Mick wrote: > > > On Sunday 14 December 2008, Neil Bothwick wrote: > > > > On Sun, 14 Dec 2008 11:47:51 +0200, Alan McKinnon wrote:

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-17 Thread Etaoin Shrdlu
On Wednesday 17 December 2008, 23:01, Neil Bothwick wrote: > On Wed, 17 Dec 2008 08:48:52 +, Mick wrote: > > Hmm, I tried this with a sequence of files that look like > > name0001stat.txt to name0198stat.txt, but when I run {0001..0198} it > > fails because it seems to ignore the zeros in 0001

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-17 Thread Neil Bothwick
On Wed, 17 Dec 2008 08:48:52 +, Mick wrote: > Hmm, I tried this with a sequence of files that look like > name0001stat.txt to name0198stat.txt, but when I run {0001..0198} it > fails because it seems to ignore the zeros in 0001 and start counting > from 1. Do I need to use some escape charact

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-17 Thread Robert Bridge
On Wed, 17 Dec 2008 15:33:35 -0500 Willie Wong wrote: > On Wed, Dec 17, 2008 at 08:48:52AM +, Mick wrote: > > On Sunday 14 December 2008, Neil Bothwick wrote: > > > On Sun, 14 Dec 2008 11:47:51 +0200, Alan McKinnon wrote: > > > > That's why I suggested them :-) I use them a lot, especially >

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-17 Thread Willie Wong
On Wed, Dec 17, 2008 at 08:48:52AM +, Mick wrote: > On Sunday 14 December 2008, Neil Bothwick wrote: > > On Sun, 14 Dec 2008 11:47:51 +0200, Alan McKinnon wrote: > > > That's why I suggested them :-) I use them a lot, especially when I > > > have to run the same set of commands on 15 different

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-17 Thread Mick
On Sunday 14 December 2008, Neil Bothwick wrote: > On Sun, 14 Dec 2008 11:47:51 +0200, Alan McKinnon wrote: > > That's why I suggested them :-) I use them a lot, especially when I > > have to run the same set of commands on 15 different hosts, then I do > > something like: > > > > for I in $(seq 1

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-14 Thread Alex Schuster
Neil Bothwick writes: > On Sun, 14 Dec 2008 11:47:51 +0200, Alan McKinnon wrote: > > for I in $(seq 1 15) ; do > > If you're using bash or zsh,you can speed this up with > > for I in {1..15}; do You can even use C style: for (( i=1; i <= 15; i++ )); do Wonko

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-14 Thread Neil Bothwick
On Sun, 14 Dec 2008 11:47:51 +0200, Alan McKinnon wrote: > That's why I suggested them :-) I use them a lot, especially when I > have to run the same set of commands on 15 different hosts, then I do > something like: > > for I in $(seq 1 15) ; do If you're using bash or zsh,you can speed this up

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-14 Thread Alan McKinnon
On Sunday 14 December 2008 11:06:39 Mick wrote: >  md5sum -c token*.md5sum are the easiest on this occasion, although Alan's > last two commands are indeed "insanely useful"!  ha!  They will be saving > me hours of typing in the future.  :) That's why I suggested them :-) I use them a lot, especia

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-14 Thread Mick
On Sunday 14 December 2008, Neil Bothwick wrote: > On Sat, 13 Dec 2008 19:59:44 -0500, Willie Wong wrote: > > Why not just a simple bash one-liner > > > > for i in token{a..z}; do md5sum -c $i; done > > What wrong with > > md5sum -c token{a..z} Thank you all for your suggestions. I think think th

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-14 Thread Neil Bothwick
On Sat, 13 Dec 2008 19:59:44 -0500, Willie Wong wrote: > Why not just a simple bash one-liner > > for i in token{a..z}; do md5sum -c $i; done What wrong with md5sum -c token{a..z} -- Neil Bothwick All Scottish food is based on a dare. signature.asc Description: PGP signature

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-13 Thread smallnow
token* is the best. I also have this useful script in my bashrc. its just an extended version of this. [[ $(md5sum < file1) == $(md5sum < file2) ]] so you can just give it two files as its argument and it returns 0 if they are the same. -v for verbose md5() { local v x y; [[ $1 =

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-13 Thread Robert Bridge
On Sat, 13 Dec 2008 23:49:50 + Mick wrote: > Hi All, > > Is there a clever way to enter a string (rather than write a script > file) so that md5sum will check a whole series of files in one go and > report success or error; I was thinking along the lines of if $value > is ... then md5sum -c

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-13 Thread Willie Wong
On Sat, Dec 13, 2008 at 11:49:50PM +, Penguin Lover Mick squawked: > Is there a clever way to enter a string (rather than write a script file) so > that md5sum will check a whole series of files in one go and report success > or error; I was thinking along the lines of if $value is ... then

Re: [gentoo-user] [OT] One line script for md5sum

2008-12-13 Thread Alan McKinnon
On Sunday 14 December 2008 01:49:50 Mick wrote: > Hi All, > > Is there a clever way to enter a string (rather than write a script file) > so that md5sum will check a whole series of files in one go and report > success or error; I was thinking along the lines of if $value is ... then > md5sum -c .

[gentoo-user] [OT] One line script for md5sum

2008-12-13 Thread Mick
Hi All, Is there a clever way to enter a string (rather than write a script file) so that md5sum will check a whole series of files in one go and report success or error; I was thinking along the lines of if $value is ... then md5sum -c ..., but my non-existent scripting knowledge won't take m