RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-29 Thread Duffy Gillman

Timo -

Consider me puzzled.  There is something missing in the spec for this 
project - what is the developer trying to do, simply get the log files? 
If so then rsync, wget, or scp from the commandline, or a gui-based scp 
tool seem much more useful than any sort of programming solution.


Ok, so barring that, I think this seems a perfect use of a scripting 
language - either perl or any of the various *sh variants.  Perl will give 
you handy, high-level file processing features that will allow the script 
to zip through a file (even in a .tgz) with very little coding.  *sh 
variants will have similar chunky, high-level features (between tar, 
find, grep and ls and a few pipes I think there is a simple solution). 
Either can be readily incorporated into Apache, and with a slight bit 
more trouble, into your favorite servlet container or (god forbid) IIS.


So really the question becomes, what is the developer comfortable with? 
In terms of professional development I'd say everyone should have some 
scripting language under their belt.  If the fellow has to depend on Java 
to do the task I'd hazzard to guess he'll spend 3-4 times longer on the 
solution.  If that is the soultion he has to fall back on, send him home 
with a copy of the Larry Wall Perl book (O'Reilly Press - wtf's the name? 
Perl in a Nutshell?), or a printout of 'man bash' (though this assumes 
he has some facility with the cadre of shell commands he'll need - cat, 
grep, find, tar, ls, ...) and tell him to grind on the solution a bit 
longer than he would have in order to get the script going in scripting 
language.  Dollars to doughnuts, I bet it pays off in time savings the 
next time he's confronted with a data crunching task.



-Duffy


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-29 Thread Robert Zeigler
I think the issue is that the developer doesn't have remote
access to the box; he can only get at the logs through the web.
So, scp and rsync are out. wget isn't, of course. :)
If it were me...  I'd do it in bash using wget.
Seems like it would be a one-liner, since you can do it in one line
w/ wget, but I'd still throw it in a bash script just so I didn't have
to go re-read the man pages on wget every time, and so I didn't have
to remember the url, etc.

Of course, as pointed out, it all depends on what you're comfortable
with.  I spend a lot of time in the shell, and have done a fair amount
of shell scripting (more than perl scripting, in any event), so... :)

Robert

Duffy Gillman wrote:
 Timo -
 
 Consider me puzzled.  There is something missing in the spec for
 this project - what is the developer trying to do, simply get the log
 files? If so then rsync, wget, or scp from the commandline, or a
 gui-based scp tool seem much more useful than any sort of programming
 solution.
 
 Ok, so barring that, I think this seems a perfect use of a scripting
 language - either perl or any of the various *sh variants.  Perl will
 give you handy, high-level file processing features that will allow the
 script to zip through a file (even in a .tgz) with very little coding. 
 *sh variants will have similar chunky, high-level features (between tar,
 find, grep and ls and a few pipes I think there is a simple solution).
 Either can be readily incorporated into Apache, and with a slight bit
 more trouble, into your favorite servlet container or (god forbid) IIS.
 
 So really the question becomes, what is the developer comfortable
 with? In terms of professional development I'd say everyone should have
 some scripting language under their belt.  If the fellow has to depend
 on Java to do the task I'd hazzard to guess he'll spend 3-4 times longer
 on the solution.  If that is the soultion he has to fall back on, send
 him home with a copy of the Larry Wall Perl book (O'Reilly Press - wtf's
 the name? Perl in a Nutshell?), or a printout of 'man bash' (though this
 assumes he has some facility with the cadre of shell commands he'll need
 - cat, grep, find, tar, ls, ...) and tell him to grind on the solution a
 bit longer than he would have in order to get the script going in
 scripting language.  Dollars to doughnuts, I bet it pays off in time
 savings the next time he's confronted with a data crunching task.
 
 
 -Duffy
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-29 Thread Tim Colson \(tcolson\)
 Groovy would be a decent solution I suspect, but wouldn't you 
 need to  layer in HttpClient or something like that to get decent HTTP

 facilities?
Yeah, but in fairness - both ruby and perl need HTTP libraries too. And
Commons HTTP Client has a nicely documented API. 

Oddly, 5 seconds ago on the urbancode anthill list, somebody just sent a
link to the beanshell manual (I believe they integrated bsh into
Anthill)
http://www.beanshell.org/manual/bshmanual.html

For somebody with primarily a Java background...it might be an
interesting option.
 

 Ant could do it, but you'd have to have Java, Ant, and to get 
 looping  you'd want ant-contrib as well :)  
I wondered about the looping...and I certainly don't want to start
debating the readability of the build.xml files... I think we've all
been there before. grin

http://groovy.codehaus.org/Ant+Scripting
Looks fun almost a little disorienting without the pointy brackets
grin

Timo

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-29 Thread Jim Secan
snip

Well, shame on you for hiding requirements details (Win32, no CygWin), but
wget is available on windoze and using it is simple enough that it can be
run from a windoze (excuse the usage) shell - the venerable batch file.
If your developer friend lives/works on windoze and can't lash together a
one-line batch file he shouldn't be allowed near a computer other than to
play games.

Also, why on earth would anyone want to handle something as simple as this
via something potentially as complicated as Java or Groovy?  This is why a
real developer has a wide range of tools in his/her kit.  And if you find
that your available tools don't fit, find and learn one that does.  I
needed a tool to make flow chart diagrams MY way, and got so frustrated
with then-available tools that I learned Postscript and wrote my own tool -
a Fortran program that built Poscript output.  I've lost count of how
useful it has been to have learned Poscript.  (Hey, maybe he could write a
Postscript program to download and PRINT the logs??!?!)

In software development as in life, if you ain't learnin' you're dyin'.

Jim

*-*---*
| Jim Secan   | Northwest Research Assoc, Inc |
| ([EMAIL PROTECTED])  | 2455 E. Speedway, Suite 204   |
| (520) 319-7773  | Tucson, Arizona 85719 |
|Space Weather Info: http://www.nwra-az.com/  |
*-*---*

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-29 Thread Todd Ellermann

Hate to actually do Microsofts job here, but when/if longhorn comes out
it will actually have FOR THE FIRST TIME EVER a real scripting
environment.  I think it is currently code named monad. I saw a demo
of it in Redmond.   The cool things you could do with it if Office was
installed include.

wget to get the log. Import into excel. generate a pie chart. email
attachement to person(s).   

You may have to do a little prep work in the excel template, but you
could then email the log results (presumably site usage statistics or
something) directly to the marketing department and skip the developer
all together.  Ofcourse if these are error logs you might have other
ideas.
-Todd

Todd R. Ellermann
President PHXJUG.org
[EMAIL PROTECTED]
602-738-6187




__ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-29 Thread josh zeidner


--- Todd Ellermann [EMAIL PROTECTED] wrote:

 
 Hate to actually do Microsofts job here, but when/if
 longhorn comes out
 it will actually have FOR THE FIRST TIME EVER a real
 scripting
 environment.

  uhh.. you mean Vista?!  Longhorn is so '04. 
Microsoft figured out that if they keep renaming it
they wont ever have to make excuses when they don't
release!

  I think it is currently code named
 monad. I saw a demo
 of it in Redmond.   The cool things you could do
 with it if Office was
 installed include.
 
 wget to get the log. Import into excel. generate a
 pie chart. email
 attachement to person(s).

  Now are you trying to tell me thats not going to use
COM? ;)

  -josh 


ps. will get back 2 u soon

   
 
 You may have to do a little prep work in the excel
 template, but you
 could then email the log results (presumably site
 usage statistics or
 something) directly to the marketing department and
 skip the developer
 all together.  Ofcourse if these are error logs you
 might have other
 ideas.
 -Todd
 
 Todd R. Ellermann
 President PHXJUG.org
 [EMAIL PROTECTED]
 602-738-6187
 
 
   
   

__
 
 Yahoo! for Good 
 Donate to the Hurricane Katrina relief effort. 
 http://store.yahoo.com/redcross-donate3/ 
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-29 Thread Duffy Gillman
Wow, see... in my defense I did start my post with a complaint that the 
spec was vague and continued from there.  I'd assumed you were talking 
about allowing the developer some place to drop a server side script 
(which made the whole thing seemingly pointless because if you can do 
that, you can probably just access the files via scp, etc.)


So let me revise - I'd use bash with the addition of wget.  It doesn't 
matter that you don't have directory index ability on the windoze box - 
you can munge the URLs based on the file naming pattern.


But then there was the new M$ thing someone mentioned... what did you say 
they're calling it... gonad?


-D


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread Tim Colson \(tcolson\)
I suspect a subject line with the P-word in it will at least hook folks
into reading this... ;-)

Problem: developer has access to a website with tar/gzipped log
files...archived into folders by year 2005/ and month 01/ 02/ and then
the filename has a date in it too - daily.

He complains, Wh! I need more than one file, so without SCP access,
I have to click click click... Whaaa!

I say, Shut up and write a 3 line script to automate the HTTP call...
and leave me alone.
(I can only imagine what he's thinking about my parentage after that IM.
;-)

But this begs a question for the group here... if he asks, What are the
three lines? and I decide to do all his freakin' work for him... then,
I'd write a little perl script because I've done this in Perl at least a
dozen times in my life so it's familiar. I wouldn't grab java because
although commons has an http client that's slick, I'd also have to write
files and I suck at that in java.  

But if I make the developer learn how to fish... well, perl might not be
apropos given his skillset (i.e. no perl), so I don't know what would be
best to suggest to him.


So if you were doing this task, how would you approach it? What tool
would you use? And more importantly, why?

-Timo
P.S. there are no bonus points for out of the box approaches like,
change the server logging setup or attach a drive share, etc. The
point is to focus on the HTTP task and how to do that.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread Erik Hatcher


On Sep 28, 2005, at 4:17 PM, Tim Colson (tcolson) wrote:

So if you were doing this task, how would you approach it? What tool
would you use? And more importantly, why?


I'd use Ruby, personally.  It'd be much more readable than the  
equivalent Perl variant, almost for sure.  The readability factors  
into the maintainability too.


One way would be to leverage the Net::HTTP library:

http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/

I use it to fetch a string from an HTTP response this way:

 # Fetch method copied from PickAxe, p. 700
def fetch(uri_str, limit=10)
   fail 'http redirect too deep' if limit.zero?

   response = Net::HTTP.get_response(URI.parse(uri_str))

   case response
  when Net::HTTPSuccess
 response
  when Net::HTTPRedirection
 fetch(response['location'], limit - 1)
  else
 response.error!
   end
end

fetch(http://www.ruby-lang.org;) # for example, which would follow  
the redirect to /en


To pull binary content, you'll have to use the API slightly  
differently, but it'll still be pretty trivial.


Erik


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread Erik Hatcher


On Sep 28, 2005, at 4:38 PM, Michael Oliver wrote:

Its more than three lines, but tell me this,


Well, it could be less code if you knew you didn't need to deal with  
redirects :)


But, to be safe, I'd guess it'd be 10 lines of clean Ruby code to do  
this task... and 3 lines of Perl-esque garbage code if you wanted to  
obfuscate it and compress it as much as possible.



Do you have to rub three times to get ruby to give you the magic?


Nope, only once.  Ruby is just that sweet.

Erik



-Original Message-
From: Erik Hatcher [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 28, 2005 1:32 PM
To: jug-discussion@tucson-jug.org
Subject: Re: [jug-discussion] Why Jython, or Jelly, or Groovy, or  
Beanshell

or ... instead of perl, or sh script?


On Sep 28, 2005, at 4:17 PM, Tim Colson (tcolson) wrote:


So if you were doing this task, how would you approach it? What tool
would you use? And more importantly, why?



I'd use Ruby, personally.  It'd be much more readable than the  
equivalent

Perl variant, almost for sure.  The readability factors into the
maintainability too.

One way would be to leverage the Net::HTTP library:

 http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/

I use it to fetch a string from an HTTP response this way:

  # Fetch method copied from PickAxe, p. 700
 def fetch(uri_str, limit=10)
fail 'http redirect too deep' if limit.zero?

response = Net::HTTP.get_response(URI.parse(uri_str))

case response
   when Net::HTTPSuccess
  response
   when Net::HTTPRedirection
  fetch(response['location'], limit - 1)
   else
  response.error!
end
 end

fetch(http://www.ruby-lang.org;) # for example, which would follow  
the

redirect to /en

To pull binary content, you'll have to use the API slightly  
differently, but

it'll still be pretty trivial.

 Erik


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread Jim Secan
At 01:17 PM 9/28/2005 -0700, you wrote:
I suspect a subject line with the P-word in it will at least hook folks
into reading this... ;-)
snip

Well, I'm not 100% clear on what's wanted, but could what he needs be done
using wget?

Jim
*-*---*
| Jim Secan   | Northwest Research Assoc, Inc |
| ([EMAIL PROTECTED])  | 2455 E. Speedway, Suite 204   |
| (520) 319-7773  | Tucson, Arizona 85719 |
|Space Weather Info: http://www.nwra-az.com/  |
*-*---*

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread Tim Colson \(tcolson\)
 [Eric would] use Ruby, personally.  It'd be much more readable than
the  
 equivalent Perl variant, almost for sure.  The readability factors  
 into the maintainability too.

Let me break that down a bit...

Can we assume you, Eric, have the experience to write either a perl or
ruby script?

So the choice of Ruby was because you believe that would be more
readable than a perl equivalent, not due... maybe because of more
familiarity with Ruby and less with Perl?

I'm trying to put that gingerly...because, well, my equivelant of your
script looks readable to me, because I know more Perl than Ruby. :-)


-Timo

# Leverage the LWP Useragent lib 
# http://search.cpan.org/~gaas/libwww-perl-5.803/lib/LWP/UserAgent.pm

 require LWP::UserAgent;
  
 my $ua = LWP::UserAgent-new;

 # agent automagically handles 7 redirects by default, but we'll
increase to 10
 $ua-max_redirect(10) 

 my $url = http://www.somewhere.com/logs/logfile.txt;;

 my $response = $ua-get($url);
 
 if ($response-is_success) {
 print $response-content;  
 }
 else {
 die $response-status_line;
 }


 One way would be to leverage the Net::HTTP library:
  http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/
 
 I use it to fetch a string from an HTTP response this way:
 
   # Fetch method copied from PickAxe, p. 700
  def fetch(uri_str, limit=10)
 fail 'http redirect too deep' if limit.zero?
 
 response = Net::HTTP.get_response(URI.parse(uri_str))
 
 case response
when Net::HTTPSuccess
   response
when Net::HTTPRedirection
   fetch(response['location'], limit - 1)
else
   response.error!
 end
  end
 
 fetch(http://www.ruby-lang.org;) # for example, which would follow  
 the redirect to /en
 
 To pull binary content, you'll have to use the API slightly  
 differently, but it'll still be pretty trivial.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread Jim Secan
At 02:03 PM 9/28/2005 -0700, you wrote:
So I'd be the guy compiling and then using Perl rather than trying to
learn how to get for loops in a shell script to work to grab all the
days in each month competent shell scripters would probably laugh at
me, and I'm okay with that. ;-)

I'm by no means a wget expert (just started using it), but I think you can
tell it to recursively download a directory structure with a single
command.  If the only stuff in those directories are the log files, or if
whatever else is in there is small, then this might be a simple solution.
A one-liner, perhaps.  The usual drawback with wget is you need an http
server on the other end, which in this case is a given.

Jim
*-*---*
| Jim Secan   | Northwest Research Assoc, Inc |
| ([EMAIL PROTECTED])  | 2455 E. Speedway, Suite 204   |
| (520) 319-7773  | Tucson, Arizona 85719 |
|Space Weather Info: http://www.nwra-az.com/  |
*-*---*

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread Tim Colson \(tcolson\)
 At least I can spell your name correctly :))
Heh heh, well, mine -is- easier to spell of course. grin
Sorry about that. :-)

 This beautiful blog entry sums up my take on readability quite a bit:
  http://onestepback.org/index.cgi/Tech/Ruby/LineNoise.rdoc
Hmm... readable means more than percentage of squiggly chars to me. Perl
gets more and less readable the more or less I work with it over the
last 2-3 months. Recent experience with any lang taints my perspective
slightly.

Although weird idiomatic things in Perl that I know about an
understand like $_ and $self-bless() --always-- look funny to me.
grin

 So in this particular case, the readability is not much different.   
 Ruby and Perl have a lot of commonalities - I just find Ruby much  
 more pleasing to the eye personally.  And I wouldn't hesitate to  
 recommend a simple Ruby script to someone over a Perl one.  Flame on!

That commonality is another reason why it's hard for me to unbiasedly
give somebody advice on what to use. When I look at Ruby, I see things
that are perl-esque and therefore familiar like the unless and the if
clause at the end of a line instead of the forefront like java expects. 

It's hard, actually impossible, to not have my background cloud my
perception of easy to read.

Dave Thomas said so many times in his talk about how Ruby just makes
more sense. I wanted to scream because ruby and perl would both lose to
english if I gave them to my Mom (who hasn't written a book on Ruby,
and lived with it for the past two years) and asked her which was more
readable. 

Let me turn the question on it's side a bit... assume your main
experience is with Java -- then what solution would that person likely
grok quicker and be able to do what EriK and I (both Recovering Perl
Users) have shown in ruby/perl? My guess is that -both- of our solutions
would be strange to somebody who hasn't ever used a perl/ruby
interpreter. 


Timo

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread Michael Oliver
Rumor has it that Microsoft has the next killer scripting language they are
calling C#Script 


Michael Oliver
CTO
Alarius Systems LLC
6800 E. Lake Mead Blvd, #1096
Las Vegas, NV 89156
Phone:(702)643-7425
Fax:(702)974-0341
*Note new email changed from [EMAIL PROTECTED]

-Original Message-
From: Tim Colson (tcolson) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 28, 2005 2:33 PM
To: jug-discussion@tucson-jug.org
Subject: RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell
or ... instead of perl, or sh script?

 At least I can spell your name correctly :))
Heh heh, well, mine -is- easier to spell of course. grin Sorry about that.
:-)

 This beautiful blog entry sums up my take on readability quite a bit:
  http://onestepback.org/index.cgi/Tech/Ruby/LineNoise.rdoc
Hmm... readable means more than percentage of squiggly chars to me. Perl
gets more and less readable the more or less I work with it over the last
2-3 months. Recent experience with any lang taints my perspective slightly.

Although weird idiomatic things in Perl that I know about an understand
like $_ and $self-bless() --always-- look funny to me.
grin

 So in this particular case, the readability is not much different.   
 Ruby and Perl have a lot of commonalities - I just find Ruby much more 
 pleasing to the eye personally.  And I wouldn't hesitate to recommend 
 a simple Ruby script to someone over a Perl one.  Flame on!

That commonality is another reason why it's hard for me to unbiasedly give
somebody advice on what to use. When I look at Ruby, I see things that are
perl-esque and therefore familiar like the unless and the if clause at the
end of a line instead of the forefront like java expects. 

It's hard, actually impossible, to not have my background cloud my
perception of easy to read.

Dave Thomas said so many times in his talk about how Ruby just makes more
sense. I wanted to scream because ruby and perl would both lose to
english if I gave them to my Mom (who hasn't written a book on Ruby, and
lived with it for the past two years) and asked her which was more
readable. 

Let me turn the question on it's side a bit... assume your main experience
is with Java -- then what solution would that person likely grok quicker and
be able to do what EriK and I (both Recovering Perl
Users) have shown in ruby/perl? My guess is that -both- of our solutions
would be strange to somebody who hasn't ever used a perl/ruby interpreter. 


Timo

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread Landon Clark
I wanted to second the vote for script / wget.  If you have directory
browsing enabled on the server, I think you can accomplish everything
you want with the following command:

wget -m URL

or something pretty similar.

Thanks,
Landon

-Original Message-
From: Michael Oliver [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 28, 2005 2:48 PM
To: jug-discussion@tucson-jug.org
Subject: RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or
Beanshell or ... instead of perl, or sh script?

Rumor has it that Microsoft has the next killer scripting language they
are calling C#Script 


Michael Oliver
CTO
Alarius Systems LLC
6800 E. Lake Mead Blvd, #1096
Las Vegas, NV 89156
Phone:(702)643-7425
Fax:(702)974-0341
*Note new email changed from [EMAIL PROTECTED]

-Original Message-
From: Tim Colson (tcolson) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 28, 2005 2:33 PM
To: jug-discussion@tucson-jug.org
Subject: RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or
Beanshell or ... instead of perl, or sh script?

 At least I can spell your name correctly :))
Heh heh, well, mine -is- easier to spell of course. grin Sorry about
that.
:-)

 This beautiful blog entry sums up my take on readability quite a bit:
  http://onestepback.org/index.cgi/Tech/Ruby/LineNoise.rdoc
Hmm... readable means more than percentage of squiggly chars to me. Perl
gets more and less readable the more or less I work with it over the
last
2-3 months. Recent experience with any lang taints my perspective
slightly.

Although weird idiomatic things in Perl that I know about an
understand like $_ and $self-bless() --always-- look funny to me.
grin

 So in this particular case, the readability is not much different.   
 Ruby and Perl have a lot of commonalities - I just find Ruby much more

 pleasing to the eye personally.  And I wouldn't hesitate to recommend 
 a simple Ruby script to someone over a Perl one.  Flame on!

That commonality is another reason why it's hard for me to unbiasedly
give somebody advice on what to use. When I look at Ruby, I see things
that are perl-esque and therefore familiar like the unless and the if
clause at the end of a line instead of the forefront like java expects. 

It's hard, actually impossible, to not have my background cloud my
perception of easy to read.

Dave Thomas said so many times in his talk about how Ruby just makes
more sense. I wanted to scream because ruby and perl would both lose to
english if I gave them to my Mom (who hasn't written a book on Ruby,
and lived with it for the past two years) and asked her which was more
readable. 

Let me turn the question on it's side a bit... assume your main
experience is with Java -- then what solution would that person likely
grok quicker and be able to do what EriK and I (both Recovering Perl
Users) have shown in ruby/perl? My guess is that -both- of our solutions
would be strange to somebody who hasn't ever used a perl/ruby
interpreter. 


Timo

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread Jim Secan
At 02:55 PM 9/28/2005 -0700, you wrote:
wget -m URL

That's pretty much it.  If there are other files in this directory
structure that you don't want, there are accept and reject options (-A and
-R) that allow you to list by suffix or by pattern those files you want or
don't want.  Details can be found on the wget manual:

http://www.gnu.org/software/wget/manual/wget.html

You could even stash this in a simple cron job.

Jim
*-*---*
| Jim Secan   | Northwest Research Assoc, Inc |
| ([EMAIL PROTECTED])  | 2455 E. Speedway, Suite 204   |
| (520) 319-7773  | Tucson, Arizona 85719 |
|Space Weather Info: http://www.nwra-az.com/  |
*-*---*

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread Jim Secan
Or, if wget doesn't fit the bill, you can also do this using rsync.  This
might even be better if the copying is to be done routinely and only new
files are wanted.

Jim
*-*---*
| Jim Secan   | Northwest Research Assoc, Inc |
| ([EMAIL PROTECTED])  | 2455 E. Speedway, Suite 204   |
| (520) 319-7773  | Tucson, Arizona 85719 |
|Space Weather Info: http://www.nwra-az.com/  |
*-*---*

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [jug-discussion] Why Jython, or Jelly, or Groovy, or Beanshell or ... instead of perl, or sh script?

2005-09-28 Thread TR




Tim Colson (tcolson) wrote:

  
Well, I'm not 100% clear on what's wanted, but could what he 
needs be done using wget?

  
  
As described, the situation is grabbing 365 log files, stored in
/MM/file_MMDD.log directories on an HTTP server. 

The question here is not to obtain a concrete solution -- but to talk
about approaches and reasons for them. I'm curiuos to see somebody tell
me -why- they might use Jython or Beanshell, or whatever to do this...
beyond, "because I know how to use Jython, it's kewl!"
  

You go to scripting with the language you know not the language you
wish you had. 

For me I often write the pseudo code in my head. I often find it
looking like one of the scripting languages I know/use and that drives
my choice. I may also choose one because it is something that I feel
a need to learn. Ruby fits that description right now. I like to term
these little languages, some I've used DOS Batch files, rexx sed/awk,
perl, ksh, bash, and ruby. 

Then there is the question of which to suggest to someone of limited
scripting use. They may be very computer savoy but have not the
experience, or realization, of little languages. For me any would
do, but I'd pick the one I knew I would be willing to teach. 

TR