shell module
David Clymer <david-LEGOU7lN1jbY0TyS/[email protected]> Fri, 03 Jun 2005 01:03:16 -0400
| Newsgroups | gmane.comp.games.mud.client.lyntin |
|---|---|
| Message-ID | <[email protected]> |
I'm planning on adding an ex-like mode for my UrwidUI where I'll allow
the user to run shell commands (!<command here>) and other fun stuff.
However, I dont think the shell thing in general should be dependant on
using my UI, so here's a module for it.
the command goes like this:
#shell {echo 'hi fred'}
or you can provide text that is piped to the command that you specify
#shell {sed -e 's/hi/bye/'} {hi fred}
command output is sent to the user by default, but can be sent to the
mud by specifying: tomud=true
#shell {sed -e 's/hi/bye/'} {say hi fred} tomud=true
the command can be run in non-blocking (default) or blocking mode,
meaning that you don't have to wait for the command to finish to go on
your merry mudding way, and you do, respectively.
There are some issues, however. I currently provide no way of
terminating a job that doesnt exit. for example:
#shell {cat} will wait forever for something to come in std input if it
isnt terminated. Of course if you run the command in the default
non-blocking mode, this all happens in the background, so you may not
care.
-davidc
--
gpg-key: http://www.zettazebra.com/files/key.gpg
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBCn+ST2XpGgG+SNaERAh3XAKDQKdF6spGJY9dm8iqLKoHtgHPgzwCgvf6G Gu8shVohekBnC0uQ8eryEy8= =n31U -----END PGP SIGNATURE-----