<ju**********@yahoo.co.inwrote in message news
Hi,
I am writing a minimal shell as a learning project. I am able to
execute simple commands through this shell, but don't know how to
execute "for/while loops" "if-then" and so on. Is there any standard
way of interpreting these ? Does anyone knows of any link that
explains this in detail ?
You need a copy of MiniBasic, how to write a script interpreter.
You could simply embed the interpreter into your shell, which would allow
you write BASIC programs on the fly.
You will need to add a syntax to call programs by name. That's not
difficult. Either add a keyword "CALL" or say that lines beginning with
unknown identifiers are calls.
Or you could strip out the line numbers to get something more like the UNIX
shells. That's a slightly bigger operation, since line number make the
interpreter a lot easier to write.
Source is available for free on the website, the book is very reasonably
priced.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.