Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommended books for building a shell/BBS Server [closed]

I am working on a independent project for school, and I need a bit of guidance on possible resources. Basically, I am trying to build a Unix-style shell (possibly porting later to Windows) in C or C++. I will add shell commands in a modular fashion, adding functionality as I go. The final step will be to ad a "connect" command which will allow a user to connect to a telnet BBS that I have designed. The BBS will also only have basic, skeletal functionality. E.G., I am probably going to have news blurbs, maybe a basic application and a basic door game.

I don't really need help with the programming (at least, not yet), but I have been having trouble finding good resources to help me out. What I am looking for is a good book on shell programming (not writing scripts, but actually programming a shell from scratch, and its various interactions with the underlying system), and a good book on adding telnet functionality- what I mean by this is that I want to use my computer as a server, and allow a few other users to connect in order to test that my system works. I am currently reading the Sans "Teach Yourself TCP/IP in 24 hours" which has proved reasonably useful for someone with a good understanding of CS, algorithms, data structures, etc. I just need something a little more specific.

Just a little background- I am a second year Computer Science student at Purdue, and I am doing this independent study in order to tie together many of the concepts I have learned thus far. If anyone could point me toward some truly excellent resources, it would be very much appreciated.

Please let me know if you need more detail or clarification in order to point me toward the appropriate resource. Note that I am willing to buy any book available if it proves to be a valuable resource. Also, I did try a search for these resources on SO, but most questions seemed to be too specific (generally about issues that someone is having with their implementation of a shell, etc.); I would also prefer personal recommendations from experienced programmers in the field.

Thanks in advance. -S

PS- To clarify "BBS" for younger programmers- this is what existed before the Internet. Old school, dial-up, text based bulletin board systems on a 2400 baud modem. I obviously can't recreate that exactly, but my hope was to synthesize the experience using telnet or SSH. See http://www.telnetbbsguide.com/ for more information on a telnet BBS. I need to be able to write my own software, though, that merely has a fraction of the functionality of a real BBS. But, I am not sure what I need to be searching for to learn more about this- should I be looking at server books, networking books, or something else entirely?

PPS- More clarification. Most of the books I have been seeing on BBS's are books about how to setup, run, and maintain a BBS as a sysop, using pre-existing software. What I need to do is write the software myself. I will likely use telnet, as it appears to be easier to use that SSH (at least, to program- please correct me if I am wrong about this). I friend of mine recommended that I get a book on patterns, and also a copy of "The Pragmatic Programmer". Please let me know if he is pointing me in the right direction for what I want to build. Also, just as a side note, I do have a pretty decent (if basic) knowledge of programming, algorithms, and data structures- but absolutely no knowledge of networking or servers and I am not really sure how much I actually need to know in order to start development on this project. Well, I know a little bit about networking, just not from a programmer's perspective. Thank you all again.

like image 658
SD_Catt Avatar asked Oct 11 '22 17:10

SD_Catt


2 Answers

There is a book about programming unix shells! written by none other than Axel Tobias-Schreiner, illustrious author of ooc.pdf, The "Object-Oriented C" PDF (Google it, but don't forget his name!).

It's called "Using C with Curses, Lex and Yacc: Building a Window Shell for Unix System V", Prentice Hall, 1990; and it really should be considered Part 3 of the saga begun in K&R "The C Programming Language", and continued in the second half of K&P "The UNIX Programming Environment".

The shell the book describes is a rogue-style "window system" that works inside the terminal (using curses), it includes a text-file viewer, and a command-language interpreter that runs commands inside of these "windows". The command language uses lex and yacc to implement the lexer/parser. So the book serves as an introduction to doing such things, a large literate program in C, and goldmine of snippets for using curses, complicated options processing, and implementing a programming language using the much-touted standard unix tools.

like image 158
luser droog Avatar answered Oct 25 '22 02:10

luser droog


I've never seen a book about programming of shells, although I'd be happy to find out that such a thing exists.

But really, isn't programming a shell basically a list of features that you'll implement AND the order of evaluation of how interpret the users input? You can see a good write-up on order of evaluation in 'Classic Shell Programming', Robbins and Beebe AND in 'C Shell Field Guide' (the Andersons) and possibly others.

Of course, you would learn a lot by digging in on the available source codes for shells, bash, z shell, ksh.

Sorry, I don't have any ideas about the BBS server part of your question. As you found the SAMS book helpful, I'd recommend looking at the W. Richard Stevens' Network Programming Series of books, which is 99% Unix network programming and maybe not what you want.

(Finally, consider changing out your recommendation tag for bash or zsh, as many regular contributors at S.O. check for new questions by searching on 'their' tags. The people that can answer your question better may not be reading it)

I hope this helps.

like image 21
shellter Avatar answered Oct 25 '22 02:10

shellter