theclapp

Search theclapp.blog-city.com

 

What's a good remote agent?

posted Friday, 13-Apr-2007
So my first proof-of-concept remote agent was a custom Perl script. 53 lines. It doesn't do much, just "fork & exec" except over there instead of over here. (Okay, it does a little more, but not much.)

So I got to thinking, somebody must've done this already. I looked around for other remote agents. I found a few (an interesting looking Perl module whose name escapes me, but search CPAN for "remote execution" and it'll probably be obvious [update: Sys::Manage::Conn]), and I even spent a few hours on mosref. But eventually I thought, Hey, a perfectly good and very extendable remote agent is this:

perl -e "eval <>"
And I smiled at that and chortled for a while and experimented and hey it does work, imagine that.

And then I realized, Well gosh, I can get clisp for Linux and AIX (my two target architectures), and that's just nifty, and so my next remote agent will be more along the lines of

clisp -q -norc -x '(eval (read *terminal-io*))'
For those of you following along at home, you have to use *terminal-io* and not *standard-input* because clisp binds *standard-input* to a string-input-stream to read the argument to -x:
$ clisp -q -norc -x '(format t "~S~%" *standard-input*)'
#<INPUT STRING-INPUT-STREAM>
NIL

tags:  

links: digg this    del.icio.us    technorati    reddit