Re: Fun Scripting Problem

2013-02-15 Thread Giorgos Keramidas
On 2013-02-13 12:27, Tim Daneliuk tun...@tundraware.com wrote: I know how to do this in Python, but I really want to do it in straight Bourne shell. I have some ideas, but I thought I'd give you folks a crack at this Big Fun: a) You have a directory of files - say they're logs - generated

Re: Fun Scripting Problem

2013-02-14 Thread Chad Perrin
On Wed, Feb 13, 2013 at 03:13:06PM -0600, Robert Bonomi wrote: here's a one-liner: rm ` \ stat -f %SB %B %N * \ | sort -k5nr \ | cut -c1-7,17-20,32- \ | awk 'BEGIN {a=;b=0;c=0} $1==a $2==b $3=c {print $4;}{a=$1;b=$2;c=$3}' \ I'm never comfortable calling something like that a

Fun Scripting Problem

2013-02-13 Thread Tim Daneliuk
I know how to do this in Python, but I really want to do it in straight Bourne shell. I have some ideas, but I thought I'd give you folks a crack at this Big Fun: a) You have a directory of files - say they're logs - generated at nondeterministic intervals. You may get more than one a

RE: Fun Scripting Problem

2013-02-13 Thread Teske, Devin
of Tim Daneliuk [tun...@tundraware.com] Sent: Wednesday, February 13, 2013 10:27 AM To: FreeBSD Mailing List Subject: Fun Scripting Problem I know how to do this in Python, but I really want to do it in straight Bourne shell. I have some ideas, but I thought I'd give you folks a crack at this Big Fun

Re: Fun Scripting Problem

2013-02-13 Thread Tim Daneliuk
On 02/13/2013 12:38 PM, Teske, Devin wrote: (apologies for top-post) As tempted as I am, I think newsyslog(8) may be what you want. Missing information in your post is how you intend to timestamp the files -- by filename? by content? If by-content, then is it a good assumption that the data

Re: Fun Scripting Problem

2013-02-13 Thread Lowell Gilbert
Tim Daneliuk tun...@tundraware.com writes: On 02/13/2013 12:38 PM, Teske, Devin wrote: (apologies for top-post) As tempted as I am, I think newsyslog(8) may be what you want. Missing information in your post is how you intend to timestamp the files -- by filename? by content? If

Re: Fun Scripting Problem

2013-02-13 Thread Robert Bonomi
Date: Wed, 13 Feb 2013 12:27:31 -0600 From: Tim Daneliuk tun...@tundraware.com Subject: Fun Scripting Problem I know how to do this in Python, but I really want to do it in straight Bourne shell. I have some ideas, but I thought I'd give you folks a crack at this Big Fun: a) You have

Re: Fun Scripting Problem

2013-02-13 Thread Karl Vogel
On Wed, 13 Feb 2013 12:53:32 -0600, Tim Daneliuk tun...@tundraware.com said: T The only way to determine the date of the file is by looking at its stat T info. There is nothing the file name or content that could be used to T infer this. Being a pedantic twit, I interpreted stat info to

Re: Fun Scripting Problem

2013-02-13 Thread Tim Daneliuk
On 02/13/2013 03:13 PM, Robert Bonomi wrote: Date: Wed, 13 Feb 2013 12:27:31 -0600 From: Tim Daneliuk tun...@tundraware.com Subject: Fun Scripting Problem I know how to do this in Python, but I really want to do it in straight Bourne shell. I have some ideas, but I thought I'd give you folks