472,090 Members | 1,328 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,090 software developers and data experts.

Re: python custom command interpreter?

On Wed, Aug 20, 2008 at 03:19:19PM -0400, joey boggs wrote:
In the end I'd like to be able to run a custom interpreter and just feed it
one command and a directory. The end result in the kickstart something like
this:

%post --interpreter #!/usr/bin/myinterpreter
DROP /tmp/directory
DROP /tmp/directory2
What is the problem you are trying to solve? Are you asking how to
write a shell in Python?

<pet peeve>
How would I setup the interpreter to take the DROP command?
You wouldn't... "setup" is a noun. You might "set up" an interpreter
though.
</pet peeve>
I've been reading and searching all day but I haven't found anything
close to what I'm doing. I realize that using custom commands in
this case is overkill but in the end is used to make the users life
easier.
How so? What could be easier than "rm -rf directory"?
If anyone can point me to some documentation I would be more than
grateful.
I'd be happy to, but I can't imagine what sort of documentation would
help you. It sounds like what you want to do, basically, is write a
program to read commands from stdin, parse them to make sure the
syntax is right, and then execute the equivalent code in Python.

--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFIrJ7SdjdlQoHP510RAuqYAKCknb97T0qTuWINmY2iRq IMdHSASgCdG0rW
f+N+2yzxsQI+K6N1hBCO4QQ=
=wLvp
-----END PGP SIGNATURE-----

Aug 20 '08 #1
3 2411
On Wed, 20 Aug 2008 18:46:42 -0400, Derek Martin wrote:
How so? What could be easier than "rm -rf directory"?
C:\>rm -rf directory
Illegal command: rm.

Hm. ;-)

Ciao,
Marc 'BlackJack' Rintsch
Aug 21 '08 #2
Marc 'BlackJack' Rintsch wrote:
>How so? What could be easier than "rm -rf directory"?

C:\>rm -rf directory
Illegal command: rm.

Hm. ;-)
does CentOS/Fedora run Windows these days?

</F>

Aug 21 '08 #3
On Thu, Aug 21, 2008 at 05:17:41AM +0000, Marc 'BlackJack' Rintsch wrote:
On Wed, 20 Aug 2008 18:46:42 -0400, Derek Martin wrote:
How so? What could be easier than "rm -rf directory"?

C:\>rm -rf directory
Yeah, except the application specified by the OP is to remove
directories during a kickstart install of Linux... so your comment is
worthless.

--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFIrWTadjdlQoHP510RAqaZAJ9DajWj9EhzcOTK4OH5dl inbmCxtQCeL3va
peWQjMl384pI3SbAE8KvROA=
=Ko56
-----END PGP SIGNATURE-----

Aug 21 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

176 posts views Thread by Thomas Reichelt | last post: by
12 posts views Thread by Rex Eastbourne | last post: by
8 posts views Thread by Paul Cochrane | last post: by
reply views Thread by rjain7 | last post: by
267 posts views Thread by Xah Lee | last post: by
29 posts views Thread by 63q2o4i02 | last post: by
29 posts views Thread by Gerald | last post: by
reply views Thread by Fredrik Lundh | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.