Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #33917 > unrolled thread

Libraries for sysadmins?

Started byElena <egarrulo@gmail.com>
First post2016-03-04 03:33 -0800
Last post2016-03-04 21:48 -0500
Articles 19 — 9 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Libraries for sysadmins? Elena <egarrulo@gmail.com> - 2016-03-04 03:33 -0800
    Re: Libraries for sysadmins? Martin Gregorie <martin@address-in-sig.invalid> - 2016-03-04 11:44 +0000
      Re: Libraries for sysadmins? egarrulo <egarrulo@gmail.com> - 2016-03-04 12:56 +0100
    Re: Libraries for sysadmins? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-03-04 07:43 -0500
    Re: Libraries for sysadmins? Robert Klemme <shortcutter@googlemail.com> - 2016-03-04 18:06 +0100
      Re: Libraries for sysadmins? egarrulo <egarrulo@gmail.com> - 2016-03-04 20:30 +0100
        Random permutations [was Re: Libraries for sysadmins?] Sebastian <news@seyweiler.dyndns.org> - 2016-03-05 00:56 +0100
          Re: Random permutations [was Re: Libraries for sysadmins?] Robert Klemme <shortcutter@googlemail.com> - 2016-03-05 12:11 +0100
            Re: Random permutations [was Re: Libraries for sysadmins?] Sebastian <news@seyweiler.dyndns.org> - 2016-03-05 16:41 +0100
              Re: Random permutations [was Re: Libraries for sysadmins?] Brixomatic <brixomatic@yahoo.com> - 2016-03-05 19:20 +0100
                Re: Random permutations [was Re: Libraries for sysadmins?] Andreas Leitgeb <avl@logic.at> - 2016-03-05 18:46 +0000
                  Re: Random permutations [was Re: Libraries for sysadmins?] Brixomatic <brixomatic@yahoo.com> - 2016-03-15 19:22 +0100
                    Re: Random permutations [was Re: Libraries for sysadmins?] Andreas Leitgeb <avl@logic.at> - 2016-03-15 22:30 +0000
              Re: Random permutations [was Re: Libraries for sysadmins?] Andreas Leitgeb <avl@logic.at> - 2016-03-05 18:30 +0000
                Re: Random permutations [was Re: Libraries for sysadmins?] Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-03-05 13:46 -0500
                  Re: Random permutations [was Re: Libraries for sysadmins?] Andreas Leitgeb <avl@logic.at> - 2016-03-05 19:40 +0000
        Re: Libraries for sysadmins? Robert Klemme <shortcutter@googlemail.com> - 2016-03-05 12:10 +0100
      Re: Libraries for sysadmins? Arne Vajhøj <arne@vajhoej.dk> - 2016-03-04 21:42 -0500
    Re: Libraries for sysadmins? Arne Vajhøj <arne@vajhoej.dk> - 2016-03-04 21:48 -0500

#33917 — Libraries for sysadmins?

FromElena <egarrulo@gmail.com>
Date2016-03-04 03:33 -0800
SubjectLibraries for sysadmins?
Message-ID<2cec6af2-9636-4a2a-8849-b01286c0814c@googlegroups.com>
Are there any libraries that make Java feel more like a scripting language?  I mean: libraries that let you write fewer lines of code for common sysadmin tasks, where you would normally choose a scripting language (for example: file I/O, piping, processing text files line by line, filtering collections, etc.)  Of course, using Java would still mean some overhead, but that is fine.

Thanks.

[toc] | [next] | [standalone]


#33918

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2016-03-04 11:44 +0000
Message-ID<nbbsei$odo$1@dont-email.me>
In reply to#33917
On Fri, 04 Mar 2016 03:33:09 -0800, Elena wrote:

> Are there any libraries that make Java feel more like a scripting
> language?  I mean: libraries that let you write fewer lines of code for
> common sysadmin tasks, where you would normally choose a scripting
> language (for example: file I/O, piping, processing text files line by
> line, filtering collections, etc.)  Of course, using Java would still
> mean some overhead, but that is fine.
>
What operating system do you want to use this with?

All your requirements are met by the usual collection of UNIX utilities 
together with awk and the bash shell. There's no reason why a similar set-
up couldn't be written in Java, but why would you bother if you're 
running a UNIX/Linux/BSD operating system and/or can install cygwin on a 
Windows system?


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#33919

Fromegarrulo <egarrulo@gmail.com>
Date2016-03-04 12:56 +0100
Message-ID<djtbfgF84l8U1@mid.individual.net>
In reply to#33918
On 04/03/16 12:44, Martin Gregorie wrote:
> What operating system do you want to use this with?

I am running Linux, but I would like to use Java anyway.

[toc] | [prev] | [next] | [standalone]


#33920

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2016-03-04 07:43 -0500
Message-ID<nbbvnk$69r$1@dont-email.me>
In reply to#33917
On 3/4/2016 6:33 AM, Elena wrote:
> Are there any libraries that make Java feel more like a scripting language?  I mean: libraries that let you write fewer lines of code for common sysadmin tasks, where you would normally choose a scripting language (for example: file I/O, piping, processing text files line by line, filtering collections, etc.)  Of course, using Java would still mean some overhead, but that is fine.

     The standard class libraries that come with Java do all of these
things.  Can you be more specific about what you want to do and how
you envision doing them?  How about an example of a task you'd like
to script?


-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

[toc] | [prev] | [next] | [standalone]


#33922

FromRobert Klemme <shortcutter@googlemail.com>
Date2016-03-04 18:06 +0100
Message-ID<djttl0Fct5hU1@mid.individual.net>
In reply to#33917
I would look into using JRuby, maybe also look into Groovy (not sure how 
much alive the latter is these days).

On 04.03.2016 16:13, Stefan Ram wrote:
> Elena <egarrulo@gmail.com> writes:
>> processing text files line by line
>
>    Writing lines to a text file:
>
> new java.io.FileWriter( "c:\\example.txt" ).
> append( "alpha\n" ).close();

In (J)Ruby:

File.open("example.txt", "a") {|io| io.puts "alpha"}

>    Reading a text file line by line (not tested):
>
> final java.util.Scanner scanner
> = new java.util.Scanner( new java.io.File( "file.txt" ));
> while( scanner.hasNextLine() )
> { final java.lang.String line = scanner.nextLine();

In (J)Ruby:

File.foreach "file.txt" do |line|
   # whatever
end

>> filtering collections
>
>    (not tested):
>
> java.util.Arrays.asList( 1, 2, 3 ).stream().
> filter( x -> "x >= 2 )

Again, in (J)Ruby:

[1,2,3].select {|x| x >= 2}

(Not exactly the same, but can easily be made to if need be.)

Kind regards

	robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#33923

Fromegarrulo <egarrulo@gmail.com>
Date2016-03-04 20:30 +0100
Message-ID<dju62bFf4ouU1@mid.individual.net>
In reply to#33922
On 04/03/16 18:06, Robert Klemme wrote:
>
> I would look into using JRuby, maybe also look into Groovy (not sure how
> much alive the latter is these days).
>
> On 04.03.2016 16:13, Stefan Ram wrote:
>> Elena <egarrulo@gmail.com> writes:
>>> processing text files line by line
>>
>>    Writing lines to a text file:
>>
>> new java.io.FileWriter( "c:\\example.txt" ).
>> append( "alpha\n" ).close();
>
> In (J)Ruby:
>
> File.open("example.txt", "a") {|io| io.puts "alpha"}
>
>>    Reading a text file line by line (not tested):
>>
>> final java.util.Scanner scanner
>> = new java.util.Scanner( new java.io.File( "file.txt" ));
>> while( scanner.hasNextLine() )
>> { final java.lang.String line = scanner.nextLine();
>
> In (J)Ruby:
>
> File.foreach "file.txt" do |line|
>    # whatever
> end
>
>>> filtering collections
>>
>>    (not tested):
>>
>> java.util.Arrays.asList( 1, 2, 3 ).stream().
>> filter( x -> "x >= 2 )
>
> Again, in (J)Ruby:
>
> [1,2,3].select {|x| x >= 2}
>
> (Not exactly the same, but can easily be made to if need be.)
>
> Kind regards
>
>      robert

Wow!  The Java version is remarkably concise and compares favourably 
with the Ruby version.  Where could I find more of these examples of 
"short and sweet" Java?  In the "Java Cookbook" (3rd edition)  by Ian F. 
Darwin, maybe?

[toc] | [prev] | [next] | [standalone]


#33925 — Random permutations [was Re: Libraries for sysadmins?]

FromSebastian <news@seyweiler.dyndns.org>
Date2016-03-05 00:56 +0100
SubjectRandom permutations [was Re: Libraries for sysadmins?]
Message-ID<nbd7c3$3jp$1@news.albasani.net>
In reply to#33923
Am 04.03.2016 21:13, schrieb Stefan Ram:
[snip]
>
>    I like to investigate how to concisely write a program to print
>    numbers simulating the German lotto »6 from 49«, where six
>    numbers are chosen from 1..49 in different programming languages.
>
>    Here is my Java version:
>
> public class Main
> { public static void main( final java.lang.String[] args )
>    { final java.util.List<java.lang.Integer> numbers =
>      java.util.stream.IntStream.rangeClosed( 1, 49 ).boxed().
>      collect( java.util.stream.Collectors.toList() );
>      java.util.Collections.shuffle( numbers );
>      java.lang.System.out.println( numbers.subList( 0, 6 ) ); }}
>
[snip]

This is good if you need about as many elements in the result as are in 
the range. But if the range is large and you need only a few elements, 
it may be better to generate numbers (without duplicates), like this:

new Random().ints(1, 50).distinct().limit(6)

[Side note, not relevant to the lotto example: IntStream#distinct() uses 
a LinkedHashSet internally, so that the order is maintained, as required 
by the java docs for Stream#distinct().]

-- Sebastian

PS: Whoever taught you to qualify the name of classes from java.lang?

[toc] | [prev] | [next] | [standalone]


#33930 — Re: Random permutations [was Re: Libraries for sysadmins?]

FromRobert Klemme <shortcutter@googlemail.com>
Date2016-03-05 12:11 +0100
SubjectRe: Random permutations [was Re: Libraries for sysadmins?]
Message-ID<djvt76Fs5qfU2@mid.individual.net>
In reply to#33925
On 05.03.2016 00:56, Sebastian wrote:

> This is good if you need about as many elements in the result as are in
> the range. But if the range is large and you need only a few elements,
> it may be better to generate numbers (without duplicates), like this:
>
> new Random().ints(1, 50).distinct().limit(6)

Are you sure this has the same probability characteristics as picking 
six random items from a list of 49?

Cheers

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#33931 — Re: Random permutations [was Re: Libraries for sysadmins?]

FromSebastian <news@seyweiler.dyndns.org>
Date2016-03-05 16:41 +0100
SubjectRe: Random permutations [was Re: Libraries for sysadmins?]
Message-ID<nbeunm$drn$1@news.albasani.net>
In reply to#33930
Am 05.03.2016 12:11, schrieb Robert Klemme:
> On 05.03.2016 00:56, Sebastian wrote:
>
>> This is good if you need about as many elements in the result as are in
>> the range. But if the range is large and you need only a few elements,
>> it may be better to generate numbers (without duplicates), like this:
>>
>> new Random().ints(1, 50).distinct().limit(6)
>
> Are you sure this has the same probability characteristics as picking
> six random items from a list of 49?
>
> Cheers
>
>      robert

I think yes, because Random#ints() is evenly distributed. And as I said, 
this is useful when the range is much larger than the sample size. The 
farther they diverge, the smaller the probability of a collision would 
become in the first place.

-- Sebastian

[toc] | [prev] | [next] | [standalone]


#33932 — Re: Random permutations [was Re: Libraries for sysadmins?]

FromBrixomatic <brixomatic@yahoo.com>
Date2016-03-05 19:20 +0100
SubjectRe: Random permutations [was Re: Libraries for sysadmins?]
Message-ID<MPG.314541d29a607e059896ad@news.aioe.org>
In reply to#33931
In article <nbeunm$drn$1@news.albasani.net>, Sebastian 
(news@seyweiler.dyndns.org) says...
> 
> Am 05.03.2016 12:11, schrieb Robert Klemme:
> > On 05.03.2016 00:56, Sebastian wrote:
> >
> >> This is good if you need about as many elements in the result as are in
> >> the range. But if the range is large and you need only a few elements,
> >> it may be better to generate numbers (without duplicates), like this:
> >>
> >> new Random().ints(1, 50).distinct().limit(6)
> >
> > Are you sure this has the same probability characteristics as picking
> > six random items from a list of 49?
> >
> > Cheers
> >
> >      robert
> 
> I think yes, because Random#ints() is evenly distributed. And as I said, 
> this is useful when the range is much larger than the sample size. The 
> farther they diverge, the smaller the probability of a collision would 
> become in the first place.

Interestingly the Javadoc is pretty specific on this detail:

See:
> https://docs.oracle.com/javase/8/docs/api/java/util/Random.html#ints-
int-int- <

"A pseudorandom int value is generated as if it's the result of calling 
the following method with the origin and bound: 
 
 int nextInt(int origin, int bound) {
   int n = bound - origin;
   if (n > 0) {
     return nextInt(n) + origin;
   }
   else {  // range not representable as int
     int r;
     do {
       r = nextInt();
     } while (r < origin || r >= bound);
     return r;
   }
 }
"
The else case should come as a surprise for a lot of people.

Kind regards,
Wanja



-- 
..Alesi's problem was that the back of the car was jumping up and down 
dangerously - and I can assure you from having been teammate to 
Jean Alesi and knowing what kind of cars that he can pull up with, 
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

[toc] | [prev] | [next] | [standalone]


#33935 — Re: Random permutations [was Re: Libraries for sysadmins?]

FromAndreas Leitgeb <avl@logic.at>
Date2016-03-05 18:46 +0000
SubjectRe: Random permutations [was Re: Libraries for sysadmins?]
Message-ID<slrnndmahv.456.avl@login.logic.tuwien.ac.at>
In reply to#33932
Brixomatic <brixomatic@yahoo.com> wrote:
>  int nextInt(int origin, int bound) {
>    int n = bound - origin;
>    if (n > 0) {
>      return nextInt(n) + origin;
>    }
>    else {  // range not representable as int
> The else case should come as a surprise for a lot of people.

Why? that's just to account for ranges whose length is greater
than Integer.MAX_VALUE, e.g.:  nextInt(-1, Integer.MAX_VALUE)

They probably could have used "long"s as fallback, tough.

[toc] | [prev] | [next] | [standalone]


#33972 — Re: Random permutations [was Re: Libraries for sysadmins?]

FromBrixomatic <brixomatic@yahoo.com>
Date2016-03-15 19:22 +0100
SubjectRe: Random permutations [was Re: Libraries for sysadmins?]
Message-ID<MPG.31527135b2b063559896ae@news.aioe.org>
In reply to#33935
In article <slrnndmahv.456.avl@login.logic.tuwien.ac.at>, Andreas 
Leitgeb (avl@logic.at) says...
> 
> Brixomatic <brixomatic@yahoo.com> wrote:
> >  int nextInt(int origin, int bound) {
> >    int n = bound - origin;
> >    if (n > 0) {
> >      return nextInt(n) + origin;
> >    }
> >    else {  // range not representable as int
> > The else case should come as a surprise for a lot of people.
> 
> Why? that's just to account for ranges whose length is greater
> than Integer.MAX_VALUE, e.g.:  nextInt(-1, Integer.MAX_VALUE)
> 
> They probably could have used "long"s as fallback, tough.

Sure it's apparent when you see the if-statement, so is the handling of 
an overflow in a proper implementation of a binary search.
But how many people you'd ask to implement such a function, would you 
guess, would not think abut the overflow and be surprised of a wrong 
result? I'd guess about half of them would be caught off guard.

Kind regards,
Wanja

-- 
..Alesi's problem was that the back of the car was jumping up and down 
dangerously - and I can assure you from having been teammate to 
Jean Alesi and knowing what kind of cars that he can pull up with, 
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

[toc] | [prev] | [next] | [standalone]


#33979 — Re: Random permutations [was Re: Libraries for sysadmins?]

FromAndreas Leitgeb <avl@logic.at>
Date2016-03-15 22:30 +0000
SubjectRe: Random permutations [was Re: Libraries for sysadmins?]
Message-ID<slrnneh3e2.456.avl@login.logic.tuwien.ac.at>
In reply to#33972
Brixomatic <brixomatic@yahoo.com> wrote:
> In article <slrnndmahv.456.avl@login.logic.tuwien.ac.at>, Andreas 
> Leitgeb (avl@logic.at) says...
>> Brixomatic <brixomatic@yahoo.com> wrote:
>> >  int nextInt(int origin, int bound) {
>> >    int n = bound - origin;
>> >    if (n > 0) {
>> >      return nextInt(n) + origin;
>> >    }
>> >    else {  // range not representable as int
>> > The else case should come as a surprise for a lot of people.
>> Why? that's just to account for ranges whose length is greater
>> than Integer.MAX_VALUE, e.g.:  nextInt(-1, Integer.MAX_VALUE)
>> They probably could have used "long"s as fallback, tough.
> Sure it's apparent when you see the if-statement, so is the handling of 
> an overflow in a proper implementation of a binary search.
> But how many people you'd ask to implement such a function, would you 
> guess, would not think abut the overflow and be surprised of a wrong 
> result? I'd guess about half of them would be caught off guard.

You could be right about that. :-)

[toc] | [prev] | [next] | [standalone]


#33933 — Re: Random permutations [was Re: Libraries for sysadmins?]

FromAndreas Leitgeb <avl@logic.at>
Date2016-03-05 18:30 +0000
SubjectRe: Random permutations [was Re: Libraries for sysadmins?]
Message-ID<slrnndm9jm.456.avl@login.logic.tuwien.ac.at>
In reply to#33931
Sebastian <news@seyweiler.dyndns.org> wrote:
> Am 05.03.2016 12:11, schrieb Robert Klemme:
>> On 05.03.2016 00:56, Sebastian wrote:
>>> new Random().ints(1, 50).distinct().limit(6)
>> Are you sure this has the same probability characteristics as picking
>> six random items from a list of 49?
> I think yes, because Random#ints() is evenly distributed.

Maybe similar enough for almost all practical purposes, but
strictly speaking, the distinct() might pass through a set
of less than 6 different ints.

Anyone care to calculate the probability of that happening?
I'm too lazy (and my skill too rusty by now), to do it myself.

> And as I said, 
> this is useful when the range is much larger than the sample
> size.

A way to deal with extremes, like "2 out of 42 tredecillions"
would be to pick one number n1 out of the whole range, and then
a second number n2 of the range reduced by 1. Then compare the
numbers, and add 1 to n2, if it is greater or equal to n1.
Once again I'm too lazy to type out the procedure for a 3rd,
4th, ..., k'th number, but it's no rocket science, anyway.

Not sure, if there are any ready-made filters for producing
random numbers from a decreasing range, and for re-adjusting
numbers depending on previous picks.

[toc] | [prev] | [next] | [standalone]


#33934 — Re: Random permutations [was Re: Libraries for sysadmins?]

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2016-03-05 13:46 -0500
SubjectRe: Random permutations [was Re: Libraries for sysadmins?]
Message-ID<nbf9c2$9d4$1@dont-email.me>
In reply to#33933
On 3/5/2016 1:30 PM, Andreas Leitgeb wrote:
> Sebastian <news@seyweiler.dyndns.org> wrote:
>> Am 05.03.2016 12:11, schrieb Robert Klemme:
>>> On 05.03.2016 00:56, Sebastian wrote:
>>>> new Random().ints(1, 50).distinct().limit(6)
>>> Are you sure this has the same probability characteristics as picking
>>> six random items from a list of 49?
>> I think yes, because Random#ints() is evenly distributed.
>
> Maybe similar enough for almost all practical purposes, but
> strictly speaking, the distinct() might pass through a set
> of less than 6 different ints.
>
> Anyone care to calculate the probability of that happening?
> I'm too lazy (and my skill too rusty by now), to do it myself.

     Zero.

     However, the running time is (in principle) unbounded.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

[toc] | [prev] | [next] | [standalone]


#33936 — Re: Random permutations [was Re: Libraries for sysadmins?]

FromAndreas Leitgeb <avl@logic.at>
Date2016-03-05 19:40 +0000
SubjectRe: Random permutations [was Re: Libraries for sysadmins?]
Message-ID<slrnndmdna.456.avl@login.logic.tuwien.ac.at>
In reply to#33934
Eric Sosman <esosman@comcast-dot-net.invalid> wrote:
> On 3/5/2016 1:30 PM, Andreas Leitgeb wrote:
>> Sebastian <news@seyweiler.dyndns.org> wrote:
>>> Am 05.03.2016 12:11, schrieb Robert Klemme:
>>>> On 05.03.2016 00:56, Sebastian wrote:
>>>>> new Random().ints(1, 50).distinct().limit(6)
>>>> Are you sure this has the same probability characteristics as picking
>>>> six random items from a list of 49?
>>> I think yes, because Random#ints() is evenly distributed.
>> Maybe similar enough for almost all practical purposes, but
>> strictly speaking, the distinct() might pass through a set
>> of less than 6 different ints.
>> Anyone care to calculate the probability of that happening?
>> I'm too lazy (and my skill too rusty by now), to do it myself.
>      Zero.
>      However, the running time is (in principle) unbounded.

Sorry, you're right.

My mistake was that I thought the stream of random ints would be
somehow limited in the number of ints generated. Seems not to be.

[toc] | [prev] | [next] | [standalone]


#33929

FromRobert Klemme <shortcutter@googlemail.com>
Date2016-03-05 12:10 +0100
Message-ID<djvt56Fs5qfU1@mid.individual.net>
In reply to#33923
On 04.03.2016 21:13, Stefan Ram wrote:

>    But it is remarkable that both languages allow to write this
>    at a similar level of abstraction (without loop statements)
>    and concepts:
>
>        1st) fill a linear container with numbers from 1 to 49,
>        2nd) shuffle it, and then
>        3rd) print the first 6,
>
>    but both languages use different formalisms for it!

Now look at the (J)Ruby solution, that does exactly what you describe above:

$ irb
irb(main):001:0> (1..49).to_a.shuffle[1, 6]
=> [27, 42, 35, 1, 37, 18]

:-)

Cheers

	robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#33926

FromArne Vajhøj <arne@vajhoej.dk>
Date2016-03-04 21:42 -0500
Message-ID<nbdh31$1lqp$1@gioia.aioe.org>
In reply to#33922
On 3/4/2016 12:06 PM, Robert Klemme wrote:
> I would look into using JRuby, maybe also look into Groovy (not sure how
> much alive the latter is these days).

It seems to still be evolving (2.4.6 was released recently), but
probably somewhat slower after Pivotal stopped sponsoring.

Arne

[toc] | [prev] | [next] | [standalone]


#33927

FromArne Vajhøj <arne@vajhoej.dk>
Date2016-03-04 21:48 -0500
Message-ID<nbdhdh$1m8a$1@gioia.aioe.org>
In reply to#33917
On 3/4/2016 6:33 AM, Elena wrote:
> Are there any libraries that make Java feel more like a scripting
> language?  I mean: libraries that let you write fewer lines of code
> for common sysadmin tasks, where you would normally choose a
> scripting language (for example: file I/O, piping, processing text
> files line by line, filtering collections, etc.)  Of course, using
> Java would still mean some overhead, but that is fine.

Java is rarely used as adhoc scripting language, so library for
common sysadmin tasks may be hard to find.

The examples you give seems to be covered by plain Java (just
like by any general purpose programming language).

If you want a scripting context, then look at BeanShell.

Example:

C:\>java -cp bsh-2.0b4.jar bsh.Interpreter
BeanShell 2.0b4 - by Pat Niemeyer (pat@pat.net)
bsh % System.out.println("Hello world!");
Hello world!
bsh % for(int i = 0; i < 10; i++) System.out.println(i);
0
1
2
3
4
5
6
7
8
9
bsh % ^Z
C:\>

Arne

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web