How to write a Unix Shell?

USENET News System news at macuni.mqcc.mq.oz
Tue Aug 28 10:24:47 AEST 1990


In article <6909 at ozdaltx.UUCP> toma at ozdaltx.UUCP (Tom Armistead) writes:
>
>Does anyone know where I can find any information on how to write a Unix
>command shell (like sh or ksh)?

There isn't any really good information around on this sort of stuff (I mean
specifically for writing shells), not that I can find anyway. You can
find interesting concepts in "Advanced UNIX programming" by Marc Rochind.
There is a whole section in there on how to write a simple UNIX shell.

>I have access to ksh and bash source, but don't want to spend the rest of
>my life trying to figure those out.

Yup!

>I would like to find out how the environment space is handled. What, if
>anything, needs to be done to siatisfy the kernel and/or the C library
>functions like getenv(), putenv() and popen(). And probally a few million
>other things that I haven't thought of.

The best thing is to go through the UNIX manuals (man 2 intro etc.) and
just find out what you can.

I have had a long interest in UNIX shells, and have implemented some simple
ones myself. What sort of a shell are you trying to put together?


				Regards,
					Martin.

Martin Foord		|	AARNET: martin at macadam.mqcs.mq.oz.au
Systems Administrator	|	UUCP:	...!uunet!macadam.mqcs.mq.oz.au!martin
Macquarie University	|	Computing Science
Australia		|	(02) 805 8940



More information about the Comp.unix.wizards mailing list