Pipes

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Pipes

hoffmanjon
Hello,
I just started using beanshell, and have found it to be a very helpful utility.  I like being able to write POJO and accessing them through the workspace.
The one thing that seems to be missing, to really make it a useful "shell", is pipes in the "Workspace" and/or "Interperter".  for example in a Unix/Linux BASH shell I could do something like this:
cat "some file" | grep "some string" | wc -l
Rather then the output of the cat statement going to standard out, it would be "piped" into my next statement which is a grep statment.  Then the output of my grep statement would be piped into the wc command and the output of that would be sent to standard out.
Is something like this possible in the "Workspace" or the "Interperter"?  Am I missing something in the manual?  Basicly I would like to be able to pass the output of one of my objects into another object that would take a String as the argument.
After reading the manual I realize that beanshell is more of a scripting Language then a shell, like the Unix/Linux BASH shell.  But to be able to use pipes would make the Beanshell a very powerful utility.

Jon Hoffman


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: Pipes

Wade Chandler-6
--- [hidden email] wrote:

> Hello,
> I just started using beanshell, and have found it to
> be a very helpful utility.  I like being able to
> write POJO and accessing them through the workspace.
> The one thing that seems to be missing, to really
> make it a useful "shell", is pipes in the
> "Workspace" and/or "Interperter".  for example in a
> Unix/Linux BASH shell I could do something like
> this:
> cat "some file" | grep "some string" | wc -l
> Rather then the output of the cat statement going to
> standard out, it would be "piped" into my next
> statement which is a grep statment.  Then the output
> of my grep statement would be piped into the wc
> command and the output of that would be sent to
> standard out.
> Is something like this possible in the "Workspace"
> or the "Interperter"?  Am I missing something in the
> manual?  Basicly I would like to be able to pass the
> output of one of my objects into another object that
> would take a String as the argument.
> After reading the manual I realize that beanshell is
> more of a scripting Language then a shell, like the
> Unix/Linux BASH shell.  But to be able to use pipes
> would make the Beanshell a very powerful utility.
>
> Jon Hoffman
>
>
>
-------------------------------------------------------
> Using Tomcat but need to do more? Need to support
> web services, security?
> Get stuff done quickly with pre-integrated
> technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1
> based on Apache Geronimo
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Beanshell-users mailing list
> [hidden email]
>
https://lists.sourceforge.net/lists/listinfo/beanshell-users
>
Pipes would not makes sense in the context of the
Beanshell especially being the Java syntax for that
symbol is the binary OR and two of them are the
logical OR.  You can simply run a method or scripted
function passing the return as the parameter like:
String doSomething(){}
void doSomethingElse(String param){/*....*/}

doSomethingElse(doSomething());

That would be the same as piping doSomething into
doSomethingElse, and it matches what the BeanShell was
designed for...the Java language scripted.

Wade


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: Pipes

hoffmanjon
In reply to this post by hoffmanjon

 -------------- Original message ----------------------
From: Wade Chandler <[hidden email]>

> --- [hidden email] wrote:
>
> > Hello,
> > I just started using beanshell, and have found it to
> > be a very helpful utility.  I like being able to
> > write POJO and accessing them through the workspace.
> > The one thing that seems to be missing, to really
> > make it a useful "shell", is pipes in the
> > "Workspace" and/or "Interperter".  for example in a
> > Unix/Linux BASH shell I could do something like
> > this:
> > cat "some file" | grep "some string" | wc -l
> > Rather then the output of the cat statement going to
> > standard out, it would be "piped" into my next
> > statement which is a grep statment.  Then the output
> > of my grep statement would be piped into the wc
> > command and the output of that would be sent to
> > standard out.
> > Is something like this possible in the "Workspace"
> > or the "Interperter"?  Am I missing something in the
> > manual?  Basicly I would like to be able to pass the
> > output of one of my objects into another object that
> > would take a String as the argument.
> > After reading the manual I realize that beanshell is
> > more of a scripting Language then a shell, like the
> > Unix/Linux BASH shell.  But to be able to use pipes
> > would make the Beanshell a very powerful utility.
> >
> > Jon Hoffman
> >
> >
> >
> -------------------------------------------------------
> > Using Tomcat but need to do more? Need to support
> > web services, security?
> > Get stuff done quickly with pre-integrated
> > technology to make your job easier
> > Download IBM WebSphere Application Server v.1.0.1
> > based on Apache Geronimo
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Beanshell-users mailing list
> > [hidden email]
> >
> https://lists.sourceforge.net/lists/listinfo/beanshell-users
> >
> Pipes would not makes sense in the context of the
> Beanshell especially being the Java syntax for that
> symbol is the binary OR and two of them are the
> logical OR.  You can simply run a method or scripted
> function passing the return as the parameter like:
> String doSomething(){}
> void doSomethingElse(String param){/*....*/}
>
> doSomethingElse(doSomething());
>
> That would be the same as piping doSomething into
> doSomethingElse, and it matches what the BeanShell was
> designed for...the Java language scripted.
>
> Wade


I agree with you that it would not make since to put it in the java scripting language.  But I was talking more about putting it in the shell (Workspace or Interperter) to were one object could be piped to another object.  You also would not have to use the "|" you could use something like "->".
Maybe I am not fully understanding what beanshell is.  From my Unix/Linux background I see the scripting language being only part of what beanshell is and the "shell" part of beanshell being the "workspace or interperter" (kind of like what the BASH shell is) to where you take the objects created using java or  "beanshell java script" and do something with them (like piping the output of one object and passing it to another object without having to write a new class).


Jon Hoffman





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: Pipes

patniemeyer

On Apr 21, 2006, at 12:45 PM, [hidden email] wrote:

>>> I just started using beanshell, and have found it to
>>> be a very helpful utility.  I like being able to
>>> write POJO and accessing them through the workspace.
>>> The one thing that seems to be missing, to really
>>> make it a useful "shell", is pipes in the
>>> "Workspace" and/or "Interperter".  for example in a
>>> Unix/Linux BASH shell I could do something like
>>> this:
>>> cat "some file" | grep "some string" | wc -l

It is possible that the extension syntax that we've proposed will  
provide some relief in this direction.  I'm sorry that we don't have  
much more to show on that yet, but hopefully soon.


Pat


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

RE: Pipes

Furash Gary
In reply to this post by hoffmanjon
Pat, this is your conscience speaking...  Put something on the beanshell
news page to describe your activities and the beanshell 3x vision...

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of
Patrick Niemeyer
Sent: Friday, April 21, 2006 10:56 AM
To: [hidden email]
Cc: [hidden email]
Subject: Re: [Beanshell-users] Pipes


On Apr 21, 2006, at 12:45 PM, [hidden email] wrote:

>>> I just started using beanshell, and have found it to be a very
>>> helpful utility.  I like being able to write POJO and accessing them

>>> through the workspace.
>>> The one thing that seems to be missing, to really make it a useful
>>> "shell", is pipes in the "Workspace" and/or "Interperter".  for
>>> example in a Unix/Linux BASH shell I could do something like
>>> this:
>>> cat "some file" | grep "some string" | wc -l

It is possible that the extension syntax that we've proposed will
provide some relief in this direction.  I'm sorry that we don't have
much more to show on that yet, but hopefully soon.


Pat


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users