Top posting or bottom posting? I don't wish to be flamed...
Yeah, this is just me playing around with Java. I took a course and I
figured if I don't use it, I'll loose it. I'm much more comfortable in AWK,
sed and ksh and have written something similar using such scripting
languages (I'm a Unix guy by trade).
> Top posting or bottom posting? I don't wish to be
> flamed...
Well, in this instance, you top posted, and it is generally not seen as a
sensible way to respond as it lacks context - the reader, who may not be the
intended message recipient, will likely experience difficulty decoding the
message since lots of scrolling may be required in order to obtain the
necessary context.
Also, it is generally considered sensible to trim a response to include only
the immediately relevant details. Thus, excising the earlier-posted code
from your response would have been prudent.
Anyway, lecture [part 1] over ;) !
> Yeah, this is just me playing around with Java. I took a course
> and I figured if I don't use it, I'll loose it. I'm much more
> comfortable in AWK, sed and ksh and have written something
> similar using such scripting languages (I'm a Unix guy by trade).
Yes, I had the feeling it might be a Java exercise, and that you may have
had scripting experience [newbies aren't usually interested in traceroutes
are they :) ?]. Given your *NIX experience, and the fact that you also work
on the Win32 platform:
* You probably know there are native Win32 versions of
the more common *NIX utilities; try: http://unxutils.sourceforge.net/
Sorry, I'm not a Cygwin fan
* The Win32 batch language is now a surprisingly powerful
command language - certainly not as elegant as 'bash', but
it now supports arithmetic / bitwise operations, interactive
I/O, command substitution, and tokenising ala 'awk' - but
easy to use and a standard offering on that platform
Still, the reason I mentioned alternatives to Java for the 'traceroute' task
is that USENET abounds with examples in which Java has been used for little
more than invoking a command utility, somehow tokenising the resultant
output, then redirecting it to a file. Java can certainly handle this type
of task [and certainly do it well], however, it really is the province of
scripting languages which can probably do it using less code, and with much
less overhead [no JVM to load].
After all, part of getting a job done right is choosing the appropriate
tool. Whilst Java has many excellent qualities, platform-specific tasks
really aren't its strong suite [not without a lot of work, anyway].
Anyway, lecture [part 2] over ;) !
<SNIP>
Finally, enjoy your Java programming. I highly recommend the tutorials here:
http://java.sun.com/docs/books/tutorial/index.html
Working through them should keep you happily challenged for quite a while :)
!
Cheers,
Anthony Borla
"J" <squibbies43@hotmail.com> scribbled on the stall wall:
> Top posting or bottom posting? I don't wish to be flamed...
Well, then don't top-post...K?
> Yeah, this is just me playing around with Java. I took a course and I
> figured if I don't use it, I'll loose it. I'm much more comfortable in AWK,
> sed and ksh and have written something similar using such scripting
> languages (I'm a Unix guy by trade).
Since JAVA is not the prefered tool to do this, I would hope it is only
an exercise. A better common tool to do this would have been PERL. The
whole perl script could probably be written in fewer lines than you
have total fingers on your hands.
J - 21 Mar 2005 03:00 GMT
> Since JAVA is not the prefered tool to do this, I would hope it is only
> an exercise. A better common tool to do this would have been PERL. The
> whole perl script could probably be written in fewer lines than you
> have total fingers on your hands.
Now that the rules have been established... bottom posting it is.
After some respectful snipping, I have used Uwin and would love to be able
to use SFU but it doesn't run on XP Home... ick
As for the Java Tutorial.. I've spent some time wandering around there,
hoping to re-inforce what I've learned in my class. The reason I chose the
traceroute was that I did something similar using awk and ksh (under Uwin)
that I just wanted to see how much work it would take to write something
similar in Java. And if you are interested in the code,
#!/usr/bin/ksh
grep "^Remote" $1 | grep "local service is" | grep -v "ftp" |
/usr/bin/cut -c34-55 > temp1
/usr/bin/awk -F, '{ print $1 }' temp1 > temp2
/usr/bin/sort -u temp2 > temp3
for ip in `/usr/bin/cat temp3`
do
tracert $ip
done > $2
rm -f temp*
Your comment on Perl is noted... however I have not found a tutorial online
which will allow me to learn the language with practical examples...any
recommendations?
> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
> News==----
> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
> Newsgroups
> ----= East and West-Coast Server Farms - Total Privacy via Encryption
> =----
Wiseguy - 21 Mar 2005 05:40 GMT
"J" <squibbies43@hotmail.com> scribbled on the stall wall:
> Your comment on Perl is noted... however I have not found a tutorial online
> which will allow me to learn the language with practical examples...any
> recommendations?
getting extremely OT for this group but no, I can't recommend any
tutorials for perl. I'd suggest perl.org website and see where you
end up.